Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 11.12.2006, 23:24   #7
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Thats the fucking code i posted the other day and today i delete because.. no one reply, no one thanks... and like i see... some people leech it in silence.

Now i have a better one, with some extra checks, a delay between buffs... you can set an item for the buff... exactly this code... but this time ... not compiled code... only NASC, do it by yourself

Code:
class buffer_npc : default_npc {

parameter:
  string fnHi = "buffer_npc001.htm";
  string fnYouAreChaotic = "buffer_npc002.htm";
  string fnNotEnoughAdena = "buffer_npc003.htm";
  string fnWait = "buffer_npc004.htm";
  int ItemBuff = 57;
  int Amount = 1000;
  int Delay = 500;

handler:
  EventHandler CREATED() {
    myself.i_ai0 = 0;
  }

  EventHandler TALKED(talker) {
    if (talker.karma > 0) myself->ShowPage(talker,fnYouAreChaotic);
    else myself->ShowPage(talker,fnHi);
  }

  EventHandler MENU_SELECTED(talker,ask,reply) {
    if ( (ask == 1) && (myself->OwnItemCount(talker,ItemBuff) >= Amount) ) {
      if( myself.i_ai0 == 0 ) {
        myself.i_ai0 = 1;
        myself->DeleteItem1(talker,ItemBuff,Amount);
        myself->AddUseSkillDesire(talker,reply,1,1,1000000);
        myself->ShowPage(talker,fnHi);
        myself->AddTimerEx(1,Delay);
      }
      else myself->ShowPage(talker,fnWait);
    }
    else myself->ShowPage(talker,fnNotEnoughAdena);
  }

  EventHandler TIMER_FIRED_EX(timer_id) {
    if( timer_id == 1 ) myself.i_ai0 = 0;
  }

}
FidoW is offline  
 


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 20:04.