Aller au contenu

Photo

Encounters restarting when re-entering the area


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Grani

Grani
  • Members
  • 554 messages
I would like the monsters defeated to respawn not after some fixed period of time but after a player re-enters the area. 

It would be easy to do with normal creatures, but I want the opponents to scale, and thus, the encounter is the best (or only) way to spawn them.

Is it possible to do so? Maybe, for example, there is a way of setting encounter's respawn time left to 0 when player enters the area?

Thanks for help.

#2
Tolkiens Padawan

Tolkiens Padawan
  • Members
  • 122 messages
It's absolutely possible. Make a script like this and set in in onenter of the (otherwise regular) encounter that covers the relevant area:

void main()
{
object oPC = GetEnteringObject();
if(GetIsPC(oPC)
 {
 if(GetLocalInt(OBJECT_SELF,"MONSTERLEVEL") == 0)
  {
  CreateObject(OBJECT_TYPE_CREATURE,"enter-low-level-creature-resref-here"),GetLocation(GetWaypointByTag("enter-waypoint-tag-here")));
   //repeat this if you want more than one creature
  }
 else if(GetLocalInt(OBJECT_SELF,"MONSTERLEVEL") == 1)
  {
 
CreateObject(OBJECT_TYPE_CREATURE,"enter-next-level-creature-resref-here"),GetLocation(GetWaypointByTag("enter-waypoint-tag-here")));
   //repeat this if you want more than one creature
  }
//go on with more else ifs for every monsterlevel you want to have

//At the end we make sure next time the next level is activated:
 SetLocalInt(OBJECT_SELF,"MONSTERLEVEL",GetLocalInt(OBJECT_SELF,"MONSTERLEVEL")+1);
 }
else return;
}


Modifié par Tolkiens Padawan, 09 août 2013 - 07:01 .


#3
Grani

Grani
  • Members
  • 554 messages
Thanks. :)