Witam, zrobi?em summon i wszystko gra, ale... jest on nie?miertelny i bije ownera, o ile pami?tam odznacza?em hostile i te? bi? ownera, i co tu zrobi??
Protok?? 8.54
spell:
[XML]function onCastSpell(cid, var)
local playerpos = getPlayerPosition(cid)
local cloth = getCreatureOutfit(cid)
local health = getCreatureHealth(cid)
local maxhealth = getCreatureMaxHealth(cid)
local MaximoSummon = 1
local summons = getCreatureSummons(cid)
if(table.maxn(summons) < MaximoSummon) then -- no summons
if getPlayerLevel(cid) <= 29 then
local clone = doCreateMonster("akamaru", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
return TRUE
elseif getPlayerLevel(cid) <= 39 then
local clone = doCreateMonster("akamaru1", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
elseif getPlayerLevel(cid) <= 49 then
local clone = doCreateMonster("akamaru2", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
elseif getPlayerLevel(cid) <= 79 then
local clone = doCreateMonster("akamaru3", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
elseif getPlayerLevel(cid) <= 99 then
end
end
end
[/XML]
monster:
[XML]<?xml version="1.0" encoding="UTF-8"?>
<monster name="Akamaru" nameDescription="akamaru" race="blood" experience="35" speed="250" manacost="300">
<health now="50" max="50"/>
<look type="420" corpse=""/>
<targetchange interval="2000" chance="0"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="1"/>
<flag attackable="0"/>
<flag hostile="0"/>
<flag illusionable="1"/>
<flag convinceable="1"/>
<flag pushable="1"/>
<flag canpushitems="0"/>
<flag canpushcreatures="0"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="15" attack="150"/>
<attack name="lifedrain" interval="1000" chance="9" range="1" min="-7" max="-13"/>
</attacks>
<defenses armor="2" defense="9"/>
<elements>
<element deathPercent="100"/>
<element holyPercent="-25"/>
</elements>
<loot>
<item id="2152" countmax="2" chance="24400"/> <!-- platinum coin -->
</loot>
</monster>[/XML]
@edit:
Zaznaczy?em attackable i mo?na bi? summona, ale... nadal bije ownera
Protok?? 8.54
spell:
[XML]function onCastSpell(cid, var)
local playerpos = getPlayerPosition(cid)
local cloth = getCreatureOutfit(cid)
local health = getCreatureHealth(cid)
local maxhealth = getCreatureMaxHealth(cid)
local MaximoSummon = 1
local summons = getCreatureSummons(cid)
if(table.maxn(summons) < MaximoSummon) then -- no summons
if getPlayerLevel(cid) <= 29 then
local clone = doCreateMonster("akamaru", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
return TRUE
elseif getPlayerLevel(cid) <= 39 then
local clone = doCreateMonster("akamaru1", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
elseif getPlayerLevel(cid) <= 49 then
local clone = doCreateMonster("akamaru2", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
elseif getPlayerLevel(cid) <= 79 then
local clone = doCreateMonster("akamaru3", playerpos)
doConvinceCreature(cid, clone)
setCreatureMaxHealth(clone, maxhealth)
doCreatureAddHealth(clone, health)
doSendMagicEffect(playerpos, 2)
elseif getPlayerLevel(cid) <= 99 then
end
end
end
[/XML]
monster:
[XML]<?xml version="1.0" encoding="UTF-8"?>
<monster name="Akamaru" nameDescription="akamaru" race="blood" experience="35" speed="250" manacost="300">
<health now="50" max="50"/>
<look type="420" corpse=""/>
<targetchange interval="2000" chance="0"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="1"/>
<flag attackable="0"/>
<flag hostile="0"/>
<flag illusionable="1"/>
<flag convinceable="1"/>
<flag pushable="1"/>
<flag canpushitems="0"/>
<flag canpushcreatures="0"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="15" attack="150"/>
<attack name="lifedrain" interval="1000" chance="9" range="1" min="-7" max="-13"/>
</attacks>
<defenses armor="2" defense="9"/>
<elements>
<element deathPercent="100"/>
<element holyPercent="-25"/>
</elements>
<loot>
<item id="2152" countmax="2" chance="24400"/> <!-- platinum coin -->
</loot>
</monster>[/XML]
@edit:
Zaznaczy?em attackable i mo?na bi? summona, ale... nadal bije ownera