Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 02.02.2006, 06:52   #2
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default

no, use myself.i_ai0
but if many players spelled at one time - last player's spell will be stored in NPC memory.
And you wrong, you should store speller id , and in MY_DYING give item not to last attacker, you mast give item to stored speller.

class mob_sa_quest_st_1 : default_npc
{
handler:
EventHandler CREATED()
{
myself.i_ai0 = 0;
myself.c_ai0 = 0;
}

EventHandler SPELLED(speller, skill_name_id)
{
if(skill_name_id == @s_soul_crystal && myself.sm.hp <= myself.sm.maxhp/2)
{
myself.c_ai0=speller;
}
}

EventHandler ATTACKED(attacker, damage)
{
//don't need anything here
//just
super;
}
EventHandler MY_DYING()
{
c1 = GetLastAttacker();
if( myself.c_ai0 !=0 )
{
if(OwnItemCount(myself.c_ai0, @red_soul_crystal_0)>1)
{
ShowSystemMessage(myself.c_ai0, 977);
}
if(OwnItemCount(myself.c_ai0, @red_soul_crystal_0)==1)
{
DeleteItem1(myself.c_ai0, @red_soul_crystal_0,1);
GiveItem1(myself.c_ai0, @red_soul_crystal_1,1);
ShowSystemMessage(myself.c_ai0, 974);
}
}
}
}
RmzVoid is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:59.