![]() |
[HELP] AI coding
I am trying to create an ai for npc that i have that will buff with specific skill once you click on him, can anyone give me some help on this.
|
Hrmmm I remember someone posting an awesome guide about ai a little while back... can't seem to find it though...
EDIT: Try this https://postpacific.loc-online.com/f...ad.php?id=1407 |
If you only need npc give 1 buff.... is very simple.
Code:
class citizen { }Change Buff1 value for other buff skill id (skill_pch.txt) that you wish npc give to u when u talk to him. |
Well i made with a little help of some topics this ai:
Code:
class clanhallbuffer : default_npc This is the code of the HTMLs' Code:
<html><body> Code:
<html><body><center> 2 Questions that i have: 1) i am not sure for the action of the HTML of buffmenu.Does it needs also the reply? 2) I saw also this post https://postpacific.loc-online.com/f...?p=50774#50774 I noticed a difference on the ai at the casting buff.My ai and the one that posted the other ai there differ in the following: I use push_parameter HolyWeapon whereas the other guy there uses push_event // reply push_const 104 What is the difference? |
just use nasc =p
Code:
class clanhallbuffer : default_npc { |
Code:
class citizen { } |
Thnx both for your answers really helpfull :)
Another 2 questions .... --what is the myself.i_ai0 = 0 (and then it is used also with = 1) ? Basically i dont understand the Code:
EventHandler CREATED() { |
When NPC is spawned (CREATED)... i_ai0 is set to 0...
When someone request a buff a condition check if i_ai0 is 0 -> if (myself.i_ai0 == 0) If is 0 means no one is using the buffer at this moment, because the first line when i request a buff is -> myself.i_ai0 = 1; now someone is using npc... and i add a timer -> AddTimerEx(1, Delay); ... this timer set i_ai0 to 0 again, now is possible to use buffer again... Delay value is set to 250 (0,25 seconds) is very little delay, maybe need increment this value, but help a lot right now. I do that because if a lot of people is trying to get buff at the same time... npc only give to a few players, but delete adena of all. "Adena" variable is amount of adena player need to be buffed. super; is call_super parameter in AI.obj, i use this because in citizen AI i have more code to use (greetings when talked) |
Aahh i understood now.Thnx really for your help :)
|
Sorry for OFFtopic: This could be stickied, it has good explanations and good practical examples!
|
ai npc coding
I have two question about AI.
fist of all I would like to create ai for mobs to have both physicalspicial and DDmagic skills. Can someone provide me an example. I have tried but it will only do one or the other not both. secondly, I have the AI code to make npc move (ie. wave, explain) I was wondering is there a code for mobs that make them move like c4 official. (i.e. bend, stretch and such) |
| All times are GMT. The time now is 16:39. |