Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. local outfit =
  2. {
  3. -- Girls
  4. {
  5. lookType = 12,
  6. lookHead = 0,
  7. lookBody = 92,
  8. lookLegs = 0,
  9. lookFeet = 0,
  10. lookAddons = 0
  11. },
  12. -- Boys
  13. {
  14. lookType = 12,
  15. lookHead = 0,
  16. lookBody = 132,
  17. lookLegs = 82,
  18. lookFeet = 94,
  19. lookAddons = 0
  20. }
  21. }
  22. local coinID = 2152
  23. local wastingInterval = 30000
  24. local wastingQuantity = 1
  25. local triggerQuantity = 100
  26. local warnOnLowSupply = FALSE
  27. local lowSupplyMargin = 200
  28. local storage = 50780
  29. -- Config << --
  30. local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
  31. setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)
  32. setConditionParam(condition1, CONDITION_PARAM_SKILL_FIST, 100)
  33. setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 100)
  34. setConditionParam(condition1, CONDITION_PARAM_SKILL_CLUB, 100)
  35. setConditionParam(condition1, CONDITION_PARAM_SKILL_SWORD, 100)
  36. setConditionParam(condition1, CONDITION_PARAM_SKILL_AXE, 100)
  37. setConditionParam(condition1, CONDITION_PARAM_SKILL_DISTANCE, 100)
  38. setConditionParam(condition1, CONDITION_PARAM_SKILL_SHIELD, 100)
  39. setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 100)
  40. setConditionParam(condition1, CONDITION_PARAM_STAT_MAGICPOINTS, 100)
  41. setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 175)
  42. setConditionParam(condition1, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 150)
  43. local condition2 = createConditionObject(CONDITION_HASTE)
  44. setConditionParam(condition2, CONDITION_PARAM_TICKS, -1)
  45. setConditionFormula(condition2, 2.5, 0, 3.0, 0)
  46. local area = createCombatArea({
  47. {0, 0, 0, 1, 0, 0, 0},
  48. {0, 1, 0, 0, 0, 1, 0},
  49. {0, 0, 0, 0, 0, 0, 0},
  50. {1, 0, 0, 2, 0, 0, 1},
  51. {0, 0, 0, 0, 0, 0, 0},
  52. {0, 1, 0, 0, 0, 1, 0},
  53. {0, 0, 0, 1, 0, 0, 0}
  54. })
  55. local animCombat =
  56. {
  57. createCombatObject(),
  58. createCombatObject()
  59. }
  60. local sexyEffect =
  61. {
  62. CONST_ME_FIREWORK_RED,
  63. CONST_ME_FIREWORK_BLUE,
  64. CONST_ME_MAGIC_RED,
  65. CONST_ME_MAGIC_GREEN
  66. }
  67. setCombatParam(animCombat[2], COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
  68. setCombatParam(animCombat[2], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
  69. setCombatParam(animCombat[1], COMBAT_PARAM_EFFECT, CONST_ME_FIREWORK_RED)
  70. setCombatParam(animCombat[1], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
  71. setCombatArea(animCombat[2], area)
  72. setCombatArea(animCombat[1], area)
  73. local function StopSuperForm(cid)
  74. if (getPlayerStorageValue(cid, storage) == 1) then
  75. setPlayerStorageValue(cid, storage, 0)
  76. doRemoveCondition(cid, CONDITION_OUTFIT)
  77. doRemoveCondition(cid, CONDITION_ATTRIBUTES)
  78. doRemoveCondition(cid, CONDITION_HASTE)
  79. end
  80. return TRUE
  81. end
  82. local function SuperForm(cid, sexIndex)
  83. local wastingQuantity = 1
  84. local triggerQuantity = 100
  85. if (isCreature(cid)) then
  86. if (getPlayerStorageValue(cid, storage) == 1) then
  87. if (getPlayerItemCount(cid, 2141) >= 1) then
  88. wastingQuantity = 0
  89. end
  90. local goldLeft = getPlayerItemCount(cid, coinID)
  91. if (goldLeft >= wastingQuantity) then
  92. local position = getCreaturePosition(cid)
  93. doPlayerRemoveItem(cid, coinID, wastingQuantity)
  94. doSendMagicEffect(position, sexyEffect[sexIndex + 2])
  95. doSendMagicEffect(position, sexyEffect[sexIndex])
  96. if (goldLeft <= lowSupplyMargin and warnOnLowSupply == TRUE) then
  97. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Coins left: " ..(goldLeft - wastingQuantity) .. "!")
  98. end
  99. addEvent(SuperForm, wastingInterval, cid, sexIndex)
  100. else
  101. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your bangle has been destroyed!")
  102. return StopSuperForm(cid)
  103. end
  104. end
  105. end
  106. end
  107. function onEquip(cid, item, slot)
  108. local wastingQuantity = 1
  109. local triggerQuantity = 100
  110. if (getPlayerItemCount(cid, 2141) >= 1) then
  111. triggerQuantity = 0
  112. end
  113. if (getPlayerItemCount(cid, coinID) >= triggerQuantity and getPlayerStorageValue(cid, storage) ~= 1) then
  114. local sexIndex = getPlayerSex(cid) + 1
  115. doCombat(cid, animCombat[sexIndex], numberToVariant(cid))
  116. doSetCreatureOutfit(cid, outfit[sexIndex], -1)
  117. setPlayerStorageValue(cid, storage, 1)
  118. doAddCondition(cid, condition1)
  119. doAddCondition(cid, condition2)
  120. doPlayerRemoveItem(cid, coinID, triggerQuantity)
  121. SuperForm(cid, sexIndex)
  122. elseif (getPlayerStorageValue(cid, storage) == 1) then
  123. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You cannot equip this now!")
  124. else
  125. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You do not have enough platinum coins!")
  126. end
  127. return TRUE
  128. end
  129. function onDeEquip(cid, item, slot)
  130. return StopSuperForm(cid)
  131. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement