Teleport out after mapcleared

Join Discord

Funpire

Dedicated Member
Dedicated Member
Jan 21, 2007
29
0
48
Anyone know what I need to do to automatically teleport the player out of the current map after he has killed all the mobs in it?

Let's say the player killed all the mobs on map:0100. I need him to be teleported back to the NPC who is on map:0 330 330.

Thanks for any help.
 

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
If you're using TD's 2.3 files, you can do somthing like this:

M2Server->Envir->MapQuest.txt:
Code:
0100	[100]	1	MobName	*	ClearOut

M2Server->Envir->MapQuest_def->ClearOut.txt:
Code:
[@main]
#IF
CHECKREALMONMAP 0100 0
#ACT
MAPMOVE 0 330 330
SET [100] 0
SET [101] 1
#SAY
Congratulations. \ \
<Exit/@exit>

M2Server->Envir->Map_def->NPC.txt:
Code:
[@main]
#IF
CHECK [102] 1
#SAY
Thanks for your help <$USERNAME>.
<Exit/@exit>
#ACT
BREAK

#IF
CHECK [101] 1
#SAY
Thanks for your help <$USERNAME>. Please take this reward. \ \
<Exit/@exit>
#ACT
SET [101] 0
SET [102] 1
GIVE Prize 1
BREAK

#ELSESAY
Do you want to help me? \ \
<Yes/@quest> || <No/@exit>

[@quest]
#IF
CHECKMAPHUMANCOUNT 0100 = 0
#ACT
CLEARMAPMON 0100
Param1 0100
Param2 <x>
Param3 <Y>
MonGen <Mobname> <Amount> <Spread>
SET [100] 1
MAP 0100
GIVE TownTeleport 1
#SAY
Clear the room. Good luck. \ \
<Exit/@exit>
#ELSESAY
There is someone in there, come back later. \ \
<Exit/@exit>
#ELSEACT
BREAK

Knocked that together in 5mins, should be ok, haven't tested it though. Let me know how it goes. You'll have to fill in a few of the gaps yourself.

p
 
Upvote 0

Funpire

Dedicated Member
Dedicated Member
Jan 21, 2007
29
0
48
Finally got it working. Only needed to put a 'BREAK' at the end of ClearOut.txt. Thanks alot for your help Preacher.

Also I used CHECKMAPMONCOUNT instead of CHECKREALMONMAP because the latter didn't work. I guess because I'm using the Lemon files.
 
Upvote 0

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
instead of 0100 u shoulda used an easier map name lind like "MAPNAME" lol :P

Think that's the map name that he was using in his server.

Finally got it working. Only needed to put a 'BREAK' at the end of ClearOut.txt. Thanks alot for your help Preacher.

Also I used CHECKMAPMONCOUNT instead of CHECKREALMONMAP because the latter didn't work. I guess because I'm using the Lemon files.

Yea CHECKREALMONMAP was somthing that TD added to his files.

Remember when using CHECKMAPMONCOUNT that it will count Taoist/Wizard pets as mobs so if they are using pets it will never class the map as cleared. You could set it so you run the following check on the NPC:

Code:
#IF
CHECKSLAVECOUNT = 0

So that wizards can't take pets in. Then in the map quest file, change it so that it compensates for Taoist Pets:

Code:
CHECKMAPMONCOUNT <MapName> < 3

p
 
Upvote 0