Hello again,
I want to have a small pirate village in which pirates are hostile to the player unless a pirate ship brings him there.
In other words, I have a script that increases reputation with pirate fraction and teleports the player to the new area.
location lTarget;object oTarget;
void main(){
object oPC = GetPCSpeaker();
if (GetGold(oPC) >= 1000) {
oTarget = GetWaypointByTag("islandpiratebay");
lTarget = GetLocation(oTarget);
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
AssignCommand(oPC, TakeGoldFromCreature(1000, oPC, TRUE));
if (GetLocalInt(oPC, "piraterep")== 0) { object oReptarget = GetObjectByTag("pirate_object");
AdjustReputation(oPC, oReptarget, 15);
SetLocalInt(oPC, "piraterep", 1);
}
}else { AssignCommand(GetObjectByTag("piratesailor"), ActionSpeakString("No gold, no sailin'!"));
}
}
The pirates themselves are supposed to appear via encounters (to make them respawn), but the problem is, whenever I arrive in the village by teleporting there (with the above script), no pirates appear at all.
They do appear, though, if I set the starting point in this area, or if I come here from another area (without the script).
I have no idea what might cause this, so if anyone could help, I'd appreciate it.
Thanks.
Modifié par Grani, 28 novembre 2013 - 08:18 .