lokolokio
Well-Known Member
Regards OT Landers i made this script for fun in the server, Im without internet because the rain, and I start to create a commander script I hope you like it.
Video Example:
Add this to 'data/spells/spells.xml'
Create a file called 'commander challenge.lua' inside of 'data/spells/scripts/monster/' and add this:
and on the monster you want to add it, just add this line on attacks:
Of course you can put the interval you want, I put it on each 4s to make the video Hope enjoy it!!
Video Example:
Add this to 'data/spells/spells.xml'
Code:
<instant name="commander challenge" words="###500" direction="0" aggressive="1" blockwalls="1" needtarget="0" needlearn="1" script="monster/commander challenge.lua" />
Create a file called 'commander challenge.lua' inside of 'data/spells/scripts/monster/' and add this:
Code:
function selectBestTarget(creature)
local t = creature:getTargetList()
local l = {}
for i = 1, #t do
local c = t[i]
local h = Creature(c)
if(h:getHealth()/h:getMaxHealth()*100 <= 60)then
table.insert(l, h.uid)
end
end
if isCreature(l[1]) then
creature:selectTarget(l[1])
end
end
function onCastSpell(creature, var)
selectBestTarget(creature)
local l = creature:getFriendList()
local f = {}
local t = creature:getTarget()
local k = Creature(t)
for i = 1, #l do
local c = l[i]
if(c:getName() == "Amazon")then
table.insert(f, c.uid)
l[i]:selectTarget(k)
end
end
return creature:say("Let's Kill " .. k:getName() .. "!", TALKTYPE_ORANGE_1)
end
and on the monster you want to add it, just add this line on attacks:
Code:
<attack name="amazon challenge" interval="4000" chance="100"/>
Of course you can put the interval you want, I put it on each 4s to make the video Hope enjoy it!!