ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
This spell takes 105 gold coins and turns them into 1 platinum coin. Why yes it does use 105, that is because it is meant (not for knights, they can cap it themselves, for mages really) to be used while hunting creatures like rotworms, where mages cap out on gold in like under an hour. With this spell they wont cap out on gold, even though their profit is reduced by 5%. And yes, I did use TGYoshi's spell creator so I give him credit for the animation part.
Anyway, add this to spells.xml:
The default, that I have it at, is level 12, 10 mana, requires magic level 8, and can only be used by druids.
Now create a file in data/spells (not in a subfolder like support or summon) called
create_platinum.lua
Video
In the video I have two stacks of gold, 100 and 29, I do the spell and I'm left with 1 platinum coin and 24 gold coins.
Anyway, add this to spells.xml:
Code:
<instant name="Transform Gold" words="exevo argentus mummus" lvl="12" mana="10" mag="8" selftarget="1" aggressive="0" script="create_platinum.lua">
<vocation name="Druid"/>
<vocation name="Elder Druid"/>
The default, that I have it at, is level 12, 10 mana, requires magic level 8, and can only be used by druids.
Now create a file in data/spells (not in a subfolder like support or summon) called
create_platinum.lua
Code:
-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush_2 = createCombatObject()
setCombatParam(combat0_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat0_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush_2,createCombatArea({{3}}))
local combat0_Brush_3 = createCombatObject()
setCombatParam(combat0_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatParam(combat0_Brush_3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush_3,createCombatArea({{0, 1, 0},
{1, 2, 1},
{0, 1, 0}}))
-- Areas/Combat for 500ms
local combat5_Brush_2 = createCombatObject()
setCombatParam(combat5_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat5_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat5_Brush_2,createCombatArea({{3}}))
local combat5_Brush_3 = createCombatObject()
setCombatParam(combat5_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatParam(combat5_Brush_3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat5_Brush_3,createCombatArea({{1, 0, 1},
{0, 2, 0},
{1, 0, 1}}))
-- Areas/Combat for 1000ms
local combat10_Brush_2 = createCombatObject()
setCombatParam(combat10_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat10_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat10_Brush_2,createCombatArea({{3}}))
local combat10_Brush_3 = createCombatObject()
setCombatParam(combat10_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatParam(combat10_Brush_3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat10_Brush_3,createCombatArea({{0, 1, 0},
{1, 2, 1},
{0, 1, 0}}))
-- Areas/Combat for 1500ms
local combat15_Brush_2 = createCombatObject()
setCombatParam(combat15_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat15_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat15_Brush_2,createCombatArea({{3}}))
local combat15_Brush_3 = createCombatObject()
setCombatParam(combat15_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatParam(combat15_Brush_3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat15_Brush_3,createCombatArea({{1, 0, 1},
{0, 2, 0},
{1, 0, 1}}))
-- Areas/Combat for 2000ms
local combat20_Brush = createCombatObject()
setCombatParam(combat20_Brush, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat20_Brush, COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN)
setCombatArea(combat20_Brush,createCombatArea({{3}}))
-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
if (isCreature(cid)) then
doCombat(cid, c, var)
if (dirList ~= nil) then -- Emit distance effects
local i = 2;
while (i < #dirList) do
doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
i = i + 2
end
end
end
end
function onCastSpell(cid, var)
local startPos = getCreaturePosition(cid)
RunPart(combat0_Brush_2,cid,var)
RunPart(combat0_Brush_3,cid,var)
addEvent(RunPart,500,combat5_Brush_2,cid,var)
addEvent(RunPart,500,combat5_Brush_3,cid,var)
addEvent(RunPart,1000,combat10_Brush_2,cid,var)
addEvent(RunPart,1000,combat10_Brush_3,cid,var)
addEvent(RunPart,1500,combat15_Brush_2,cid,var)
addEvent(RunPart,1500,combat15_Brush_3,cid,var)
addEvent(RunPart,2000,combat20_Brush,cid,var)
if getPlayerItemCount(cid, ITEM_GOLD_COIN) >= 105
then
doPlayerRemoveItem(cid, ITEM_GOLD_COIN, 105)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
return true
end
return true
end
Video
In the video I have two stacks of gold, 100 and 29, I do the spell and I'm left with 1 platinum coin and 24 gold coins.