yasminismyworld
Member
For example fire elemental that autoattacks everyone, (even the player summoning it)
Post your animated dead script in spells, I don't feel like looking for your sources.. We can edit that file to build this script your requestingThe Forgotten Server - Version 0.3 (Crying Damson).
behaviour: summon cant be controled after getting summoned & auto attacks every player on sight (summoner too)
local function doTargetCorpse(cid, pos)
local getPos = pos
getPos.stackpos = 255
corpse = getThingfromPos(getPos)
if(corpse.uid > 0 and isCreature(corpse.uid) == FALSE and isInArray(CORPSES, corpse.itemid) == TRUE) then
doRemoveItem(corpse.uid)
doPlayerSummonCreature(cid, "Skeleton", pos)
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
return LUA_NO_ERROR
end
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return LUA_ERROR
end
function onCastSpell(cid, var)
local pos = variantToPosition(var)
if(pos.x ~= 0 and pos.y ~= 0 and pos.z ~= 0) then
return doTargetCorpse(cid, pos)
end
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return LUA_ERROR
end
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, 2 * 1000)
function onSay(player, words, param)
local orig = player:getPosition()
if not isInArray({1, 2, 5, 6}, player:getVocation():getId()) then
player:sendCancelMessage("Your vocation cannot use this spell.")
orig:sendMagicEffect(CONST_ME_POFF)
return
end
local monsterTyp = MonsterType(param)
if not monsterTyp then
player:sendCancelMessage("Sorry, not possible.")
orig:sendMagicEffect(CONST_ME_POFF)
return
end
if not monsterTyp:isSummonable() then
player:sendCancelMessage("You cannot summon this creature.")
orig:sendMagicEffect(CONST_ME_POFF)
return
end
local manaCost = monsterTyp:getManaCost()
if player:getMana() < manaCost then
player:sendCancelMessage("You have not enough mana.")
orig:sendMagicEffect(CONST_ME_POFF)
return
end
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendCancelMessage("You are exhausted.")
orig:sendMagicEffect(CONST_ME_POFF)
return
end
local creatureId = doSummonCreature(param, orig)
if creatureId ~= false then
local monster = Monster(creatureId)
player:addMana(-manaCost)
player:addCondition(exhaust)
monster:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
orig:sendMagicEffect(CONST_ME_MAGIC_BLUE)
else
player:sendCancelMessage("There is not enough room.")
orig:sendMagicEffect(CONST_ME_POFF)
return
end
return true
end
<talkaction words="utevo res wild" separator=" " script="summonwild.lua"/>
utevo res wild monsterNameHere
Code:function onCastSpell(cid, var) doCreateMonster("Fire Elemental", getCreaturePosition(cid) return true end
Make a new spell file, and then in spells.xml add a new spell.Where im supposed to add/edit that part? thanks