Jump to content
  • 0

How to disable mercenaries on scripts?


Question

Posted (edited)

Hello everyone,

 

I wanted to ask how to prohibit mercenaries on my scripts.

 

I have these lines on my special warper that prohibits pets:

 

	//pet check
	if (petstat(PET_LEVEL) != 0) {
		mes .@n$;
		mes "Sorry, pets are not allowed.";
		close;
	}

What lines do I need to put in my NPC to prohibit mercenaries and mercenary scrolls?

 

12301,Doppelganger_Scroll,Doppleganger Summoning Scroll,2,0,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ mercenary_create 1966,1800000; },{},{}

 

 

I also have this OnPCLoadMapEvent: NPC.

 

    sc_end SC_KAIZEL;
    sc_end SC_KAAHI;

 

How do I make it to automatically disable mercenaries upon warp in?

 

 

Thank you guys!

 

 

Edited by johnbond

12 answers to this question

Recommended Posts

Posted

1.

if (getmapxy(@mapname$,@mapx,@mapy,2)==0) {
mes .@n$;
mes "Sorry, pets are not allowed.";
close;
}

2. You can set an array to check for Mercenary scrolls in your inventory / cart, if I'm not mistaken Brian had posted a code for it a few days ago.

3. I find "merc_delete", but currently don't know how to use it. Or you can to forcefully delete it via SQL on both table 'mercenary' and 'mercenary_owner'.



But if you forcefully delete it on SQL, you won't get the faith point.

Posted
if( getmercinfo(0) ){
	mes "Mercenary are not allowed";
	close2;
	warp "prontera",155,181;
	end;
}

Yes this is what I need. Thank you for this!

 

Btw, if a player has mecenary then enters a map, how can I disable his mercenary? Some kind of sc_end line? Because participants are recalled by GMs and they do not pass the NPC above.

 

Thank you.

Posted
-    script    hjkl    -1,{
OnPCLoadMapEvent:
    if( strcharinfo(3) == "<Your Event Map Name>" )
        if( getmercinfo(0) ){
            dispbottom "Mercenary are not allowed";
            warp "prontera",155,181;
        }
    end;
}

<Your Event Map Name>    mapflag    loadevent

You can try OnPCLoadMapEvent label

Posted

I get errors.


 


I just remembered that I am still using 3ceam SRCs. I tried to find the script command "getmercinfo" at root\doc\script_commands.txt
but there was none. Thats the reason I get errors on these scripts
since it is not supported in my SRC perhaps. Is there any other way to
check for mercenaries other than getmercinfo? Because I dont have it.


 


Thanks.

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...