View Full Version : [HELP] Ai mob ddmagic
I am refining my SA quest. In ai i have a class setup for each mob that can level crystal. the problem i have is in C3 and C4 alot of these mobs have ddmagic and holdmagic classes as well. how can i tell AI to use both
class halingka : warrior_aggressive_casting_curse
class_end
class halingka: crystal_monster
class_end
how do i combined those two for that mob.
I tried here. dont know if this will work though.
class timak_orc_crystal : crystal_monster
parameter_define_begin
int HoldMagic 1036037
parameter_define_end
class_end
you have to recode the ATTACKED handler too, to make this mob able to use ddmagic and holdmagic.
first question will be, define when it must use ddmagic and so when it must use holdmagic ? (conditions) the most easy way is : random i suppose :D
no I was not asking how to make mob use both ddmagic and hold magic, my question is for example. timak_orc.
timak_orc has class already defined in AI as
class timak_orc : warrior_casting_hold_magic : warrior
class_end
I want to add my ai for SA quest so that this mob can also use the holdmagic and my ai for crystal_monster class. The example I have here is what i have done. I dont know that this is right. I just add a parameter define statement and skill id.
class timak_orc_crystal : crystal_monster
parameter_define_begin
int HoldMagic 1036037
parameter_define_end
class_end
ah, ok, i have understand i think now :D
so, i dont know exactly what there is in crystal_monster class but if you want this mob use holdmagic, you have to add the parameter yes
And the right ATTACKED handler too (you can find it in "warrior_casting_hold_magic" class) if the mob is not inherit of this class
kiralex2
17.03.2006, 20:48
class test : warrior
{
parameter:
int DDMagic = @s_twister41;
handler:
EventHandler ATTACKED(attacker, damage)
{
if(attacker.is_pc != 0 || IsInCategory(@summon_npc_group, attacker.npc_class_id))
{
if(Skill_GetConsumeMP(DDMagic) < myself.sm.mp && Skill_GetConsumeHP(DDMagic) < myself.sm.hp)
{
AddUseSkillDesire(attacker, DDMagic, @ST_ATTACK, @AMT_STAND, 1000000);
}
}
super;
}
}
NASC RUlezzz
При кадом ударе моб будет кастовать эту хрень пока у него MP некончится
Как доделать думайте сами
int DDMagic = @s_elemental_symphony;
And Your die
one possibility is to modify one of the superclasses
modify the warrior class to affect nearly all monsters
but this depends on what u want to do
@kiralex2:
u forgot the Skill_InReuseDelay ;)
(this was added with C1 to all use_skill macros, but the NASC source is pre C1 but our actual AI contains this thingy)
create a crystal_monster class for each of the superclasses you wish to derive from. crystal_monster_casting_hold_magic : warrior_casting_hold_magic for example.
Then derive the timak_orc from the crystal monster subclass.
class_begin timak_orc : crystal_monster_casting_hold_magic
class_end
huh, thats my code.. dude. but thanks