• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Spell Scroll

Bazi

Member
Joined
Oct 24, 2011
Messages
270
Reaction score
8
Location
Germany
Hey OTLand i have an Script For Spells but if i create a spell i musst make for what voc is the spell and i make there for druid, elder druid
and lvl 70.000 but i wana that u get the spell only if u use the spell scrool not a normaly spell and i have that scripts show please help me ! :D

Data/actions/scripts:

PHP:
local spell = "Druid"
local words = "Druid Ice"
function onUse(cid, item, fromPos, itemEx, toPos)
if getPlayerLearnedInstantSpell(cid, spell) then
doPlayerPopupFYI(cid, "You already know how to cast this spell.")
else
doPlayerLearnInstantSpell(cid, spell)
doRemoveItem(item.uid, 1)
doPlayerPopupFYI(cid, "You learned ... " ..spell.. " for cast it use the words: " ..words.. ".")
end
return true
end


Data/actions/actions.xml:

<action itemid="8267" event="script" value="spells/spell.lua"/>




Here The Spell: Data/spells/scripts

PHP:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Druid = createCombatObject()
setCombatParam(combat0_Druid, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatParam(combat0_Druid, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat0_Druid, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatArea(combat0_Druid,createCombatArea({{2}}))
function getDmg_Druid(cid, level, maglevel)
	return (2100)*-1,(99999999)*-1 
end
setCombatCallback(combat0_Druid, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Druid")
local dfcombat0_Druid = {CONST_ANI_SMALLICE}local combat0_Druid1 = createCombatObject()
setCombatParam(combat0_Druid1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatParam(combat0_Druid1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatArea(combat0_Druid1,createCombatArea({{2}}))
function getDmg_Druid1(cid, level, maglevel)
	return (2100)*-1,(999999)*-1 
end
setCombatCallback(combat0_Druid1, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Druid1")
local dfcombat0_Druid1 = {CONST_ANI_FIRE}local combat0_Druid = createCombatObject()
setCombatParam(combat0_Druid, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat0_Druid, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)
setCombatParam(combat0_Druid, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatArea(combat0_Druid,createCombatArea({{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0},
{1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1},
{0, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 0},
{1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1},
{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0}}))
function getDmg_Druid(cid, level, maglevel)
	return (2100)*-1,(9999999)*-1 
end
setCombatCallback(combat0_Druid, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Druid")
local dfcombat0_Druid = {CONST_ANI_ICE,0,0,0,1,0,2,0,3,0,4,-1,0,-2,0,-3,0,-4,0,0,-1,0,-2,0,-3,0,-4,1,0,2,0,3,0,4,0,-1,1,-1,-1,1,-1,1,1,-2,2,2,2,2,-2,-2,-2,-3,-1,-1,-3,-3,-3,1,-3,3,-1,3,-3,3,1,1,3,3,3,-1,3,-3,1,-3,3,-5,0,5,0,-6,1,-6,-1,6,1,6,-1,0,5,1,6,-1,6,0,-5,1,-6,-1,-6}

-- =============== 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_Druid,cid,var,dfcombat0_Druid,startPos)
	RunPart(combat0_Druid1,cid,var,dfcombat0_Druid1,startPos)
	RunPart(combat0_Druid,cid,var,dfcombat0_Druid,startPos)
	return true
end

/Data/spells/spells.xml
PHP:
	<instant name="Druid" words="Druid Ice" lvl="70000" maglv="5" mana="2000" exhaustion="2000" prem="0" needlearn="0" blockwalls="0" aggressive="1" event="script" value="Druid.lua">
	<vocation id="2"/>
	<vocation id="6"/>
</instant>

Please Help me OTLand Thx :)

- - - Updated - - -

There is The Error

[27/07/2012 16:39:21] [Error - Action Interface]
[27/07/2012 16:39:21] data/actions/scripts/spells/spell.lua: onUse
[27/07/2012 16:39:21] Description:
[27/07/2012 16:39:21] (luaDoPlayerLearnInstantSpell) Player not found

Please Help ! Thx
 
Last edited:
Back
Top