Daijin
Joined: 09 Jul 2007 Posts: 23 Location: Dunjon/Warr Acres, Ok
|
Posted: Sat Jul 14, 2012 20:32 Post subject: Converting scripts to persistience. To learn from... |
|
|
Can someone show me how to convert these to persistence so I have a basic understanding to learn from?
//::///////////////////////////////////////////////
//:: Teleport: Place Binding
//:: x4_s0_teleport1
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Creates a "portal" at the caster's location.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
//Spellcast Hook Code
if (!X2PreSpellCastCode())
return;
// End of Spell Cast Hook
object oCaster = OBJECT_SELF;
location lTarget = GetLocation(oCaster);
//Clear existing bindings if any
object oBinding = GetLocalObject(oCaster, "oBinding");
if (oBinding != OBJECT_INVALID)
{
DestroyObject(oBinding);
DeleteLocalObject(oCaster, "oBinding");
}
oBinding = CreateObject(OBJECT_TYPE_WAYPOINT, "x4_wp_telebnd", lTarget);
//If this binding is placed, assign values
if (GetIsObjectValid(oBinding) == TRUE)
{
DelayCommand(1.0, SetLocalObject(oCaster, "oBinding", oBinding));
DelayCommand(1.0, SetLocalObject(oBinding, "oCreator", oCaster));
}
}
and
//::///////////////////////////////////////////////
//:: Teleport: Place Binding
//:: x4_s0_teleport1
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Jump the caster and all associates to the previously placed
"binding."
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
void main()
{
//Spellcast Hook Code
if (!X2PreSpellCastCode())
return;
// End of Spell Cast Hook
object oCaster = OBJECT_SELF;
object oBinding = GetLocalObject(oCaster, "oBinding");
if (oBinding != OBJECT_INVALID)
{
object oTeleport = GetFirstFactionMember(oCaster, FALSE);
while (oTeleport != OBJECT_INVALID)
{
//* Take the Caster and anybody who calls them master
if ((oTeleport == oCaster) || (GetMaster(oTeleport) == oCaster))
{
AssignCommand(oTeleport, ClearAllActions(TRUE));
AssignCommand(oTeleport, ActionJumpToObject(oBinding, FALSE));
}
oTeleport = GetNextFactionMember(oCaster, FALSE);
}
}
else
{
SendMessageToPC(oCaster, "You must place a portal before teleporting!");
}
} _________________ Daijin Dreamweaver, Leader of the Dream Warriors for 32 Earth years.
Faith, Loyalty, Honor, Truth and Friendship always.
I live to serve, O' Lord Jesus, Thy Will Be Done! |
|