Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2010
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. local outfit =
  2. {
  3. -- Girls
  4. {
  5. lookType = 12,
  6. lookHead = 19,
  7. lookBody = 53,
  8. lookLegs = 92,
  9. lookFeet = 79,
  10. lookAddons = 0
  11. },
  12. -- Boys
  13. {
  14. lookType = 12,
  15. lookHead = 19,
  16. lookBody = 79,
  17. lookLegs = 3,
  18. lookFeet = 81,
  19. lookAddons = 0
  20. }
  21. }
  22. local coinID = ITEM_CRYSTAL_COIN
  23. local wastingInterval = 1000
  24. local wastingQuantity = 1
  25. local triggerQuantity = 1
  26. local warnOnLowSupply = TRUE
  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, 120)
  33. setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 120)
  34. setConditionParam(condition1, CONDITION_PARAM_SKILL_CLUB, 120)
  35. setConditionParam(condition1, CONDITION_PARAM_SKILL_SWORD, 120)
  36. setConditionParam(condition1, CONDITION_PARAM_SKILL_AXE, 120)
  37. setConditionParam(condition1, CONDITION_PARAM_SKILL_DISTANCE, 120)
  38. setConditionParam(condition1, CONDITION_PARAM_SKILL_SHIELD, 120)
  39. setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 120)
  40. setConditionParam(condition1, CONDITION_PARAM_STAT_MAGICPOINTS, 120)
  41. setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 180)
  42. setConditionParam(condition1, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 180)
  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_YELLOW,
  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. if (isCreature(cid)) then
  84. if (getPlayerStorageValue(cid, storage) == 1) then
  85. local goldLeft = getPlayerItemCount(cid, coinID)
  86. if (goldLeft >= wastingQuantity) then
  87. local position = getCreaturePosition(cid)
  88. doPlayerRemoveItem(cid, coinID, wastingQuantity)
  89. doSendMagicEffect(position, sexyEffect[sexIndex + 2])
  90. doSendMagicEffect(position, sexyEffect[sexIndex])
  91. if (goldLeft <= lowSupplyMargin and warnOnLowSupply == TRUE) then
  92. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Coins left: " ..(goldLeft - wastingQuantity) .. "!")
  93. end
  94. addEvent(SuperForm, wastingInterval, cid, sexIndex)
  95. else
  96. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your bangle has been destroyed!")
  97. doPlayerRemoveItem(cid, 2127, 1)
  98. return StopSuperForm(cid)
  99. end
  100. end
  101. end
  102. end
  103. function onEquip(cid, item, slot)
  104. if (getPlayerItemCount(cid, coinID) > triggerQuantity and getPlayerStorageValue(cid, storage) ~= 1) then
  105. local sexIndex = getPlayerSex(cid) + 1
  106. doCombat(cid, animCombat[sexIndex], numberToVariant(cid))
  107. doSetCreatureOutfit(cid, outfit[sexIndex], -1)
  108. setPlayerStorageValue(cid, storage, 1)
  109. doAddCondition(cid, condition1)
  110. doAddCondition(cid, condition2)
  111. doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
  112. doPlayerAddMana(cid, getPlayerMaxMana(cid) - getPlayerMana(cid))
  113. doPlayerRemoveItem(cid, coinID, triggerQuantity)
  114. SuperForm(cid, sexIndex)
  115. elseif (getPlayerStorageValue(cid, storage) == 1) then
  116. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You cannot equip this now!")
  117. else
  118. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You do not have enough coins!")
  119. end
  120. return TRUE
  121. end
  122. function onDeEquip(cid, item, slot)
  123. return StopSuperForm(cid)
  124. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement