![]() |
|
|
#1 |
|
Архивный участник
Join Date: Jun 2005
Posts: 364
|
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 |
|
|
|
|
#2 |
|
Архивный участник
Join Date: May 2005
Posts: 99
|
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
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Jun 2005
Posts: 364
|
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 |
|
|
|
|
#4 |
|
Архивный участник
Join Date: May 2005
Posts: 99
|
ah, ok, i have understand i think now
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 |
|
|
|
|
#5 |
|
Архивный участник
Join Date: Jan 2006
Posts: 73
|
Code:
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;
}
}
При кадом ударе моб будет кастовать эту хрень пока у него MP некончится Как доделать думайте сами int DDMagic = @s_elemental_symphony; And Your die |
|
|
|
|
#6 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
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) |
|
|
|
|
#7 |
|
Архивный участник
Join Date: Feb 2006
Posts: 87
|
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 |
|
|
|
|
#8 |
|
Архивный участник
Join Date: Jun 2005
Posts: 364
|
huh, thats my code.. dude. but thanks
|
|
|
|
|