Aller au contenu

Photo

xp script


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

#1
twcheney

twcheney
  • Members
  • 36 messages
I am would like to make a script to give a character xp upon leaving an area with a quest item without killing a spawn monster. This would be so a character could potentially use sneakiness or diplomacy or other skill to overcome the creature without killing.

Any thoughts how this would be done. I am very inept at scripting.

Thanks

#2
Dann-J

Dann-J
  • Members
  • 3 161 messages
Something like this as the OnExit script for the area should do the trick:

#include "nw_io_tool"

void main()
{
object oArea = GetArea(OBJECT_SELF);
int iDone = GetLocalInt(oArea, "Done");
if (iDone) return;//prevents the script running more than once

object oMonster = GetObjectByTag("tag_of_monster");//set this to the unique tag of the creature
object oPC = GetExitingObject();
int iHasItem = CheckPartyForItem(oPC, "tag_of_item");//set this to the tag of the item
if (iHasItem && !GetIsDead(oMonster)
{
SetLocalInt(oArea, "Done", 1);
GiveXPToCreature(oPC, 1000);//set value to amount of XP you want
}

}

#3
twcheney

twcheney
  • Members
  • 36 messages
Thanks I'll see how this works.