Buddywarrior wrote...
_Knightmare_ wrote...
If Zejan's changes don't work for you let us know. I'll write up a script that uses the waypoints as I suggested. Should work for MP/PW just as well as for SP. You just need to tag the waypoint uniquely when spawned, simple to do.
I'll be happy to take a look at how you solve this problem Knightmare.
Here you go. Just threw it together, does compile fine but untested in game. Comments within script should tell you what's going on. Let me know how things turn out:
void main()
{
object oPC = GetItemActivator();
object oItem = GetItemPossessedBy(oPC,"solusekseye");
// If item activator is not a PC or is in combat, send message and end script
if (!GetIsPC(GetItemActivatedTarget()) || GetIsInCombat(GetItemActivator()))
{
SendMessageToPC(GetItemActivator(), "You can not cast that now!");
return;
}
// Check to see if we have a location set already (int "Bind" == 1)
if(GetLocalInt(oItem, "Bind") == 1)
{
// Find the dynamically tagged WP and jump to it
object oWP = GetObjectByTag(GetFirstName(oPC) + GetLastName(oPC) + GetLocalString(oItem, "RandNum"));
location lLocWP = GetLocation(oWP);
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lLocWP)));
DestroyObject(oWP, 60.0); // Destroy the WP after 60 seconds to allow for loading times
}
// No location set yet, so create one, then jump player somewhere else
if(GetLocalInt(oItem, "Bind") != 1)
{
location lLocPC = GetLocation(oPC);
int nRand = d100();
// Save the Random number result so the "if condition" above can find it
object oItem = GetItemPossessedBy(oPC,"solusekseye");
SetLocalString(oItem, "RandNum", IntToString(nRand));
// Spawn in a waypoint at PC's location
// Dynamically tag the WP with PC's First Name + PC's Last Name + a Random Number
object oWP = CreateObject(OBJECT_TYPE_WAYPOINT, "nw_waypoint001", lLocPC, FALSE, GetFirstName(oPC) + GetLastName(oPC) + IntToString(nRand));
}
}
Should work for MP/PW play, unless 2 player happen to have the exact same First and Last name PLUS happen to roll the exact same random number.
Modifié par _Knightmare_, 26 février 2011 - 10:04 .