![]() |
[Share] Valakas AI + Skills
From 99net. Works perfectly. Now only if my npcs would show their skill animations :(
Code:
class valakas : warrior |
Thanks Eanae!
Maybe Hex is needed for Anims, don't you think? |
No. I thought there was an AI function. So you would just this AI, uncompiled, then add the animation, and your good to go. Skill animation should work fine.
|
/*Off topic
It's strange.. sometimes I understand better the "Transladated English" from the russians, than you Kenster.. EOF*/ |
Quote:
|
the animations of the npc is bound to skills.
when the AI uses the right skill, the client will display the animation btw - this AI is using all the skills but not with the right checks! :( s_valakas_tail_stomp <- should not be used when the PC is in front of Valakas the AI contains some small mistakes (it's a copy-n-paste patchwork) here is a slightly corrected nasc-style version of this AI: [php:1:b2de5df799]. class valakas : warrior { handler: EventHandler ATTACKED(attacker) { if (attacker.is_pc != 0 || IsInCategory(@npc_summon_group, attacker.npc_class_id)) { if (Rand(100) < 20) { AddUseSkillDesire(attacker, @s_valakas_lava_skin, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9001, 1000); } else if (Rand(100) < 30) { AddUseSkillDesire(attacker, @s_valakas_trample, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9002, 1000); } else if (Rand(100) < 40) { AddUseSkillDesire(attacker, @s_valakas_trample_ex, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9003, 1000); } else if (Rand(100) < 50) { AddUseSkillDesire(attacker, @s_valakas_meteor_storm, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9004, 1000); } else if (Rand(100) < 20) { AddUseSkillDesire(attacker, @s_valakas_tail_stomp, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9005, 1000); } else if (Rand(100) < 30) { AddUseSkillDesire(attacker, @s_valakas_tail_stomp_ex, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9006, 1000); } else if (Rand(100) < 40) { AddUseSkillDesire(attacker, @s_valakas_breath_low, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9007, 1000); } else if (Rand(100) < 50) { AddUseSkillDesire(attacker, @s_valakas_breath_high, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9008, 1000); } else if (Rand(100) < 20) { AddUseSkillDesire(attacker, @s_valakas_tail_lash, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9009, 1000); } else if (Rand(100) < 99) { AddUseSkillDesire(attacker, @s_valakas_fear, 0, 1, 1000000); myself.c_ai0 = attacker; AddTimerEx(9010, 1000); } } } EventHandler USE_SKILL_FINISHED() { if (myself.c_ai0.alive == 0) { myself.c_ai0 = 0; exit; } if (Rand(100) < 20) { AddTimerEx(9001, 2000); } else if (Rand(100) < 25) { AddTimerEx(9002, 2000); } else if (Rand(100) < 25) { AddTimerEx(9003, 2000); } else if (Rand(100) < 25) { AddTimerEx(9004, 2000); } else if (Rand(100) < 25) { AddTimerEx(9005, 2000); } else if (Rand(100) < 25) { AddTimerEx(9006, 2000); } else if (Rand(100) < 25) { AddTimerEx(9007, 2000); } else if (Rand(100) < 25) { AddTimerEx(9008, 2000); } else if (Rand(100) < 25) { AddTimerEx(9009, 2000); } else if (Rand(100) < 25) { AddTimerEx(9010, 2000); } } EventHandler TIMER_FIRED_EX(timer_id) { if (timer_id == 9001) { AddUseSkillDesire(myself.c_ai0, @s_valakas_lava_skin, 0, 1, 1000000); } else if (timer_id == 9002) { AddUseSkillDesire(myself.c_ai0, @s_valakas_trample, 0, 1, 1000000); } else if (timer_id == 9003) { AddUseSkillDesire(myself.c_ai0, @s_valakas_trample_ex, 0, 1, 1000000); } else if (timer_id == 9004) { AddUseSkillDesire(myself.c_ai0, @s_valakas_meteor_storm, 0, 1, 1000000); } else if (timer_id == 9005) { AddUseSkillDesire(myself.c_ai0, @s_valakas_tail_stomp, 0, 1, 1000000); } else if (timer_id == 9006) { AddUseSkillDesire(myself.c_ai0, @s_valakas_tail_stomp_ex, 0, 1, 1000000); } else if (timer_id == 9007) { AddUseSkillDesire(myself.c_ai0, @s_valakas_breath_low, 0, 1, 1000000); } else if (timer_id == 9008) { AddUseSkillDesire(myself.c_ai0, @s_valakas_breath_high, 0, 1, 1000000); } else if (timer_id == 9009) { AddUseSkillDesire(myself.c_ai0, @s_valakas_tail_lash, 0, 1, 1000000); } else if (timer_id == 9010) { AddUseSkillDesire(myself.c_ai0, @s_valakas_fear, 0, 1, 1000000); } super; } }[/php:1:b2de5df799] there are no range checks, np mp/hp checks, no tracking of different attackers, no tracking/attacking of buffers/supporters. he acts like a normal (non agressive) warrior with 10 extra skills ;) (and quickly floods his desire queue) ok, it's working but only a quick-n-dirty way to get him ingame ^^ |
Thanks, I wanted that badly :P
|
Nice one eanae
|
The AI is crap, those of you who feel at home in AI, knows what im talking about - im sure..
|
that's what I said, it's only a quick-n-dirty thing...
for example, it uses the first skill twice (after first attack) 1sec after a skill is finished a new skill is added to desire queue... and ... the next skill ist casted on the last attacker ... and some more things that's why i posted the nasc style ai... because it's easier to read ;) |
yes and it crashes the npc server when its summoned for sometime
|
Re: [Share] Valakas AI + Skills
NPC server doesn't crash. I had it summoned for one hour or so and it didn't crash.
|
Fast And easy..
|
tnx
|
| All times are GMT. The time now is 23:20. |