Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== Hercules Script ======================================
- //= @callmonster <monster_id>
- //= For: VNRO
- //====== Modified By ==================
- //= Added Set Item Requirements : Zhao Chow ( Plug and Play PH )
- //= Added Set Item Count : Zhao Chow ( Plug and Play PH )
- //===== By: ==================================================
- //= ndh
- - script callmonster FAKE_NPC,{
- OnInit:
- bindatcmd "callmonster", strnpcinfo(0) + "::OnCallMonster";
- .callmonsterDuration = 60; // phut
- set .ItemID,7711; // Item needed to summon monster (Default 7711 : Event Ticket )
- set .ItemCount,1; // How many items needed to summon monster ( Default : 1 )
- end;
- OnCallMonster:
- if(Hp == 0) {
- dispbottom "Can't Call if died.";
- end;
- }
- if(callmonsterhaveMonster > 0) {
- dispbottom "Only call 1 per times.";
- end;
- }
- // Proccess argument
- .@argument$ = "";
- for (.@i = 0; .@i < .@atcmd_numparameters; ++.@i) {
- .@argument$ += (.@i > 0 ? " " : "") + .@atcmd_parameters$[.@i];
- }
- .@monsterId = atoi(.@argument$);
- // Find card ID
- .@cardId = .ItemID;
- .@ItemNeeded = .ItemCount;
- if(getmobdrops(.@monsterId)) {
- .@count = $@MobDrop_count;
- copyarray .@item[0],$@MobDrop_item[0],.@count;
- for (.@i = 0; .@i < .@count; ++.@i) {
- //item type 6 la card, getiteminfo(id,2) -> get item type
- if(getiteminfo(.@item[.@i],2) == 6) .@cardId = .@item[.@i];
- }
- if(.@cardId == -1) {
- dispbottom "Not available in db";
- end;
- }
- } else {
- dispbottom "Can't find monster";
- end;
- }
- // Find card ID in inventory
- if(countitem(.@cardId) > .@ItemNeeded) {
- delitem .@cardId, .@ItemNeeded;
- atcommand "@summon " + .@monsterId + " " + .callmonsterDuration;
- callmonsterhaveMonster = 1;
- addtimer (.callmonsterDuration * 60 * 1000), strnpcinfo(3)+"::OnMonsterGone";
- dispbottom "Called monster in 60 mins!";
- }
- else {
- dispbottom "Can't call monster, pls check "
- + getitemname(.@cardId)
- + " in your inventory, Need "+getitemname(.@cardId)+" "+.@ItemNeeded+" to call";
- end;
- }
- end;
- OnMonsterGone:
- callmonsterhaveMonster = 0;
- end;
- OnPCDieEvent:
- callmonsterhaveMonster = 0;
- end;
- OnPCLogoutEvent:
- callmonsterhaveMonster = 0;
- end;
- OnWhisperGlobal:
- set getd(@whispervar0$), atoi(@whispervar1$); // debug function
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement