Thorn
Spriting since 2013
hiii, i have this problem, i have a script that a book gives you a spell, but the problems are 2
1) if you use the book in the floor, it doesn't dissapear, only if you are wearing it
2) all my players have the spell (i mean all knights and ek) but i want that only the people who use the book can get that spell
plzzz someone help me :c i got the script from here
here are my script and spell
and here is my spell just in case
plzzz someone tell me what's going on :C
1) if you use the book in the floor, it doesn't dissapear, only if you are wearing it
2) all my players have the spell (i mean all knights and ek) but i want that only the people who use the book can get that spell
plzzz someone help me :c i got the script from here
PHP:
http://otland.net/f16/item-give-spell-183416/
here are my script and spell
LUA:
local spell = "Supreme exori"
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not getPlayerLearnedInstantSpell(cid, spell) then
doPlayerLearnInstantSpell(cid, spell)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned spell " .. spell .. "!")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
else
doCreatureSay(cid, "You already know this spell!", TALKTYPE_ORANGE_1, nil, cid, getThingPos(cid))
doPlayerRemoveItem(cid, 1964, 1)
end
return true
end
XML:
<action itemid="1964" event="script" value="knight.lua"/>
and here is my spell just in case
LUA:
-- SpellCreator generated.
-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatParam(combat0_Brush, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WHIRLWINDSWORD)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1}}))
setCombatFormula(combat0_Brush, COMBAT_FORMULA_SKILL, 2, 0, 2, 0)
local dfcombat0_Brush = {CONST_ANI_WHIRLWINDSWORD,1,0,1,1,0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,0,2,2,0,-2,0,0,-2,2,-2,-2,-2,-2,2,2,2,2,1,2,-1,1,-2,-1,-2,-2,-1,-2,1,-1,2,1,2}
-- =============== 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,cid,var,dfcombat0_Brush,startPos)
return true
end
LUA:
<instant name="supreme exori" words="supreme exori" lvl="100" mana="500" prem="1" needweapon="1" exhaustion="1600" needlearn="0" event="script" value="supreme exori.lua">
<vocation id="4"/>
<vocation id="8"/>
</instant>
plzzz someone tell me what's going on :C