Aller au contenu

Photo

setting creature active when quest accepted(solved)


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

#1
777lewis777

777lewis777
  • Members
  • 16 messages
I am trying to make a team of creatures active after a quest is accepted. I have very little knowlege of scripting but I assume that it needs to be added to my area script. here is the script I have writtin:

#include "events_h"
#include "plt_kill_the_wolves"
#include "wrappers_h"
void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    switch(nEventType)
    {
         case EVENT_TYPE_TEAM_DESTROYED:
         {
              if(GetEventInteger(ev,0) == 1)
              {
                   WR_SetPlotFlag(PLT_KILL_THE_WOLVES, MONSTERS_SLAIN, TRUE);
              }
              break;
         }
    }
    HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}

so i am guessing that I need to add something like this


if WR_SetPlotFlag(PLT_KILL_THE_WOLVES, QUEST_ACCEPTED, TRUE);
SetObjectActive(oaod_wolves_field,TRUE);

If so where in the script should i put it?

Modifié par 777lewis777, 07 mars 2010 - 10:39 .


#2
Magic

Magic
  • Members
  • 187 messages
I assume you accept the quest through a conversation. So the standard method is to use a plot event script.

It seems you already have a plot "kill_the_wolves" with a flag "QUEST_ACCEPTED", yes? "kill_the_wolves" and "QUEST_ACCEPTED" need to be inserted in the action fields of your conversation where the quest is accepted.

In your plot event script, which should look like the script template "Custom plot events.txt", add the following to the EVENT_TYPE_SET_PLOT's "switch"-command:

case QUEST_ACCEPTED:
    UT_TeamAppears(1);
    break;

In the template this would be in line 40. In your own script, you need to insert it where the plot flag setting is handled. UT_TeamAppears() is a function from utility_h.nss, which handles the activation of the wolves. So you may need an #include "utility_h".

If oaod_wolves_field is an array (?), you would need to call SetObjectActive() for each creature individually anyway to make it work. From your script, I further assumed your wolves have the team ID 1. I hope this also makes things clearer.

Modifié par Magic, 07 mars 2010 - 07:02 .


#3
777lewis777

777lewis777
  • Members
  • 16 messages
Thanks got it working now. My plot was using the plot_core script. So i changed it to my own and added

case QUEST_ACCEPTED:

UT_TeamAppears(1);

break;

like you said now it works :)