PDA

View Full Version : AI Help on determining level difference between PC and Mob


montejo1974
03.12.2005, 18:39
Hi, ppl...

Im building an event for Christmas. I would like to know how to determine the difference of leves between the mob and the last attacker...

I dont know If there is a function to retrieve the level of the monster, or a variable that maintain the monster level and the last attacker level....

Thanks in advance.

kvoxi
03.12.2005, 19:49
PC_level=GetLastAttacker().level;
NPC_level=myself.sm.level;
AI code:

//PC level
//c0=GetLastAttacker()
push_event // c0
push_const 272
add
push_reg_sp
fetch_i
shift_sp 1
func_call 83 // func[GetLastAttacker]
assign
shift_sp -1
// PC_level <=> c0.level
push_event // c0
push_const 272
add
fetch_i
push_const 888 //level
add
fetch_i
....

// NPC level
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // level
push_const 888
add
fetch_i

thats all, if u need determine levels

montejo1974
03.12.2005, 19:54
Thank you very much, this will be very useful for me ;)...I will try it soon