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
xp script
Débuté par
twcheney
, févr. 21 2013 11:34
#1
Posté 21 février 2013 - 11:34
#2
Posté 22 février 2013 - 12:01
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
}
}
#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
Posté 25 février 2013 - 07:26
Thanks I'll see how this works.





Retour en haut






