Hide and Seek event: at scheduled times, an NPC hides on a random map over several rounds, with hints broadcast over time. The first player to talk to the NPC during a round wins and receives that round's reward bag.

Requirements

  • PluginPlus has been purchased and Data\Plugin\Plugin.ini has PluginPlus = 1 (see PluginPlus).
  • Enable="1" in Data\Plugin\HideAndSeek.xml (the sample file has Enable="0").
  • Runs only on normal sub-servers; it does not run on Event / Siege / ArkaWar servers. Each sub-server runs its own event independently.
  • Only <Map> tags whose map exists on that sub-server are used.
  • The reward bag (ItemBagID) must be declared in Data\Scripts\Item\ItemBagScript.lua (type ItemBag_Event). The sample file uses bags 677 / 678 / 679.
  • No separate client file is needed.

Event flow

  1. The server finds the nearest start time in the schedule (<Start>, searching the next 400 days). Times follow the game server's clock.
  2. 5 minutes before the start time: a server-wide announcement "starts in 5 minutes" (Lang 0).
  3. Round 1 starts: round announcement (Lang 1) and the map + time limit (Lang 2). The NPC appears on a random map / spot. From round 2, the NPC moves to a different map than the previous round (if more than one usable map exists).
  4. During the round: every 5 minutes remaining, the time is announced (Lang 4); the <Hint> hints are sent in order of ID once the round has run for DisplayTime minutes (sent verbatim, not through Lang).
  5. The first person to talk to the NPC: the NPC says Lang 8, the whole server receives Lang 3, fireworks are launched (if FireWorks="1") and the winner receives the round's ItemBagID bag; the round ends.
  6. Time runs out and nobody found it: announcement Lang 10, the round ends.
  7. After each round, if rounds remain: announcement Lang 11, wait NextRoundTime minutes, then go to the next round. After MaxRounds rounds: announcement Lang 5, wait EndTime minutes (the NPC is removed), then go back to looking for the next start time.

Others who talk to the NPC after someone has won: hear Lang 7 (with the winner's name); the winner talking again: Lang 9; if nobody has won (the round ended due to timeout): Lang 6.

Configuration

File: Data\Plugin\HideAndSeek.xml. Do not write comments inside tags. The & character in text must be written as &amp;.

HideAndSeek tag

KeyValueDefaultMeaning
Enable0 / 10Disables / enables the event.
FireWorks0 / 10Launch fireworks for the player who finds the NPC.
MaxRoundsnumber0Maximum number of rounds. The number of declared <Round> tags must equal this value; if a round is not declared, the event stops when it reaches that round.

Schedule tag

KeyValueDefaultMeaning
NextRoundTimeminutes0Break time between rounds.
EndTimeminutes0Time after the last round before the event closes and the NPC is removed.

Start tag (each tag is one start time)

KeyValueDefaultMeaning
Yearyear, or -1-1Start year; -1 = no restriction.
Month1-12, or -1-1Start month.
Day1-31, or -1-1Day of the month.
DayOfWeek1-7, or -1-1Day of the week: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday.
Hour0-23, or -1-1Hour; -1 = every hour.
Minute0-59, or -1-1Minute; -1 = every minute.
Second0-59, or -1-1Second; -1 = second 0.

Round tag (inside Rounds)

KeyValueDefaultMeaning
Numbernumber from 10Round sequence number. A value ≤ 0 is an error: the log writes Invalid Round Number and loading of the rest (including locations) stops.
Timeminutes0Round duration.
ItemBagIDbag ID0Item bag given to the winner (see Data\Scripts\Item\ItemBagScript.lua).

Map, Spawn, Hint tags (inside Locations)

KeyValueDefaultMeaning
Map / Numbermap number0Map containing the NPC hiding spots.
Map / NPCTypeNPC ID0NPC ID in Data\Monster\MonsterList.xml (must be an NPC, Type = 4).
Spawn / StartX, StartYcoordinates0First corner of the NPC placement area.
Spawn / EndX, EndYcoordinates0Last corner of the NPC placement area. This area is used like a monster spawn area (the NPC is placed at a cell chosen within the area).
Spawn / Dir-1 to 70Direction the NPC faces. Actual code behavior: values 0-7 are used as is, -1 or anything outside 0-7 = random. The direction table in the file's comments (0 center, 1 Southwest, 2 South, 3 Southeast, 4 East, 5 Northeast, 6 North, 7 Northwest, 8 West) is a description from the sample file; 8 is in practice treated as random. [TO VERIFY: the direction name corresponding to each number 0-7 in the client has not been cross-checked]
Hint / IDnumber from 00Hint ID, unique within each Spawn; hints are sent in ID order.
Hint / TextstringemptyHint content, sent verbatim to the whole server.
Hint / DisplayTimeminutes0The minute within the round (counted from the start of the round) at which the hint is shown.

Configuration example

<HideAndSeek Enable="0" FireWorks="1" MaxRounds="3">
	<Schedule NextRoundTime="1" EndTime="1">
		<Start Year="-1" Month="-1" Day="-1" DayOfWeek="-1" Hour="10" Minute="0" Second="-1" />
		<Start Year="-1" Month="-1" Day="-1" DayOfWeek="-1" Hour="14" Minute="0" Second="-1" />
	</Schedule>
	<Rounds>
		<Round Number="1" Time="8" ItemBagID="677" />
		<Round Number="2" Time="8" ItemBagID="678" />
		<Round Number="3" Time="8" ItemBagID="679" />
	</Rounds>
	<Locations>
		<Map Number="0" NPCType="258">
			<Spawn StartX="7" StartY="47" EndX="7" EndY="47" Dir="-1">
				<Hint ID="0" Text="H&amp;S Hint: Becoming cold.." DisplayTime="3" />
				<Hint ID="1" Text="H&amp;S Hint: Starts snowing.." DisplayTime="6" />
			</Spawn>
		</Map>
	</Locations>
</HideAndSeek>

The sample file also declares maps 1 (Noria) and 2 (Devias), with two hiding spots on each map.

Messages (Lang)

The HideAndSeek section in Data\Lang\*.xml:

IDContent (English)
0Hide And Seek will start after %d minutes
1Hide And Seek Round %d started!
2Find a NPC in %s to get a reward! Time Limit: %d minutes
3%s found hidden NPC and got reward!
4Hide And Seek Round %d will end after %d minutes
5Hide And Seek is over!
6No one found me in a proper time!
7You are too late, %s found me first!
8You got me! This is your reward!
9You already got your reward.
10Round over - no one found hidden NPC
11Next round will start after %d minutes

Reloading the configuration

Click Reload plugin in the GameServer control panel: the hidden NPC is removed and the event restarts from looking for the next start time in the schedule (if it is in the middle of a round, that round is cancelled).