Pls help me complete this script!!!

dungpt8782

New member
Messages
63
Points
0
Age
43
Emulator
//===== Hercules Script ======================================
//= @callmonster <monster_id>
//= For: VNRO
//===== By: ==================================================
//= ndh

- script callmonster -1,{
OnInit:
bindatcmd "callmonster", strnpcinfo(0) + "::OnCallMonster";
.callmonsterDuration = 60; // phut
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 = -1;
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) > 0) {
delitem .@cardId, 1;
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 1 card 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;
}

THanks you!!!!

 
So you just leave a block of code without any description to say what it does, and expect someone to complete it for you... 

 
Last edited by a moderator:
I think it's a way to summon monsters to fight for you if you have their given card, kind of like a summoning system where you use a card to call upon the monster that's locked inside the card. That's my assumption. I finally fixed my PC guys, so I'm back on Hercules. I'll look into this script and see if it works for Hercules or not.

 
Here, i already fixed it for you.

You can set the ITEM to summon

You can set how many items need to summon

Script Link : http://pastebin.com/xTXM1u3m

Edit : Next time put some description if what will be the problems so that we can fix it immediately, its hard to debug script without knowing the bugs/errors

 
Last edited by a moderator:
Yeah thanks for some portions of yours but your logic was a little off @Zhao Chow. I was a bit mislead also. Basically this is like a Card Summoning system via @commands. What's intended is they use a Card, like if they have a Lunatic Card, they would type @callmonster 1063, which would then consume the specified Lunatic Card, as well as the items used to summon the Lunatic. A cool way to use your extra cards? I also included @callmonedit so you can edit the Item ID and Item Amount required for summoning a monster with your cards, designed for GM use.

I made a different version that I'll be making a topic about. I'll update you guys with a link to it in a little bit.

http://herc.ws/board/topic/13088-cmd-callmonster-callmonedit/

 
Last edited by a moderator:
Yeah thanks for some portions of yours but your logic was a little off @Zhao Chow. I was a bit mislead also. Basically this is like a Card Summoning system via @commands. What's intended is they use a Card, like if they have a Lunatic Card, they would type @callmonster 1063, which would then consume the specified Lunatic Card, as well as the items used to summon the Lunatic. A cool way to use your extra cards? I also included @callmonedit so you can edit the Item ID and Item Amount required for summoning a monster with your cards, designed for GM use.

I made a different version that I'll be making a topic about. I'll update you guys with a link to it in a little bit.

http://herc.ws/board/topic/13088-cmd-callmonster-callmonedit/
I see, i thought that i need some items haha, mislead too.. but thank you for that fixed
default_tongue.png


Edit : maybe they can use mine if they want to use items rather than card 
default_biggrin.png


 
Last edited by a moderator:
Back
Top