Advertisement
Slowhand-VI

MS: main.fos player entering map

Dec 31st, 2015
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // put code after this part
  2. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3. // Called when a critter enters a map.
  4. void map_critter_in(Map& map, Critter& cr)
  5. {
  6.     SetWalkRunTimeForNpcs(map, 0);
  7.     RemoveArenaItems(cr);
  8.     Location@ loc = map.GetLocation();
  9.  
  10. //// from here
  11.  
  12.     //  Check for Mysterious Stranger perk, and spawn the stranger if needed.
  13.     if (_IsRealPlayer(cr) && doesPlayerHaveMsPerk(cr.Id))
  14.     {
  15.         MS_LOG("Player has MS perk and entering map.");
  16.         if (loc.IsEncounter())
  17.         {
  18.             MS_LOG("Checking and possibly spawning MS for encounter.");
  19.             spawnMysteriousStrangerForEncounter(cr.Id);
  20.         }
  21.         if (isMsAvailableOnMap(cr.Id))
  22.         {
  23.             //  Add MS special spawn event for FA or Doctor appearance.
  24.             MS_LOG("MS is allowed on this map, adding spawn event to player-attacked.");
  25.             addMsSpawnEventsToPlayer(cr);
  26.         }
  27.         else
  28.         {
  29.             MS_LOG("MS is not allowed on this map, removing spawn event from player-attacked");
  30.             removeMsSpawnEventsFromPlayer(cr);
  31.         }
  32.     }
Advertisement
RAW Paste Data Copied
Advertisement