Jump to content
  • 0
Sign in to follow this  
dungpt8782

Pls help me complete this script!!!

Question

//===== 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!!!!

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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

Edited by Smokexyz

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Edited by Zhao Chow

Share this post


Link to post
Share on other sites
  • 0

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/

Share this post


Link to post
Share on other sites
  • 0

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 :P

 

Edit : maybe they can use mine if they want to use items rather than card  :D

Edited by Zhao Chow

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.