I made these cutes scripts for portal , andf i want shared with the Comunity
You need made 3 screeps and 2 personalited pleacetables
-1 objet with only power self only
-1 pleac table: the original portal
1 pleacetable: the destination portal
- The script object:* = create an portal with invocate FX
Blockquote
//abre un portal que te porta al ciudad
void main()
{
object oPC;
if (GetIsObjectValid(GetItemActivatedTarget())
|| GetIsInCombat(GetItemActivator())
){
SendMessageToPC(GetItemActivator(), “Esto no se usa así…”);
return;}
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
lTarget = GetItemActivatedTargetLocation();
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, “portal1”, lTarget);
oTarget = oSpawn;
//Visual effects can’t be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP’s location instead
int nInt;
nInt = GetObjectType(oTarget);
if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget));
else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)));
}
Blockquote
Blockquote
- The portal ( create a twint portal, it self destroy and teleport party ) **On USED
//Crea un portal gemelo , se autodestruye y teleporta party
//Put this script OnUsed
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTarget;
oTarget = OBJECT_SELF;
DestroyObject(oTarget, 0.0);
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag(“wp_portalcity”);
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, “portal2”, lTarget);
oTarget = GetWaypointByTag(“wp_portalcity1”);
lTarget = GetLocation(oTarget);
//only do the jump if the location is valid.
//though not flawless, we just check if it is in a valid area.
//the script will stop if the location isn’t valid - meaning that
//nothing put after the teleport will fire either.
//the current location won’t be stored, either
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
SetLocalLocation(oPC, “ls_stored_loc”, GetLocation(oPC));
oTarget=GetFirstFactionMember(oPC, FALSE);
while (GetIsObjectValid(oTarget))
{
AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionJumpToLocation(lTarget));
oTarget=GetNextFactionMember(oPC, FALSE);
}
}
- The destination portal ( destroy itself, teleport party and re-destroy original portal ( for be sure it s destroyed, lool!) * ON USED
//Put this script OnUsed
// regreso
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTarget;
oTarget = OBJECT_SELF;
DestroyObject(oTarget, 0.0);
oTarget = GetObjectByTag(“portal1”);
DestroyObject(oTarget, 0.0);
oTarget = OBJECT_SELF;
DestroyObject(oTarget, 0.0);
location lTarget;
lTarget = GetLocalLocation(oPC, “ls_stored_loc”);
//only do the jump if the location is valid.
//though not flawless, we just check if it is in a valid area.
//the script will stop if the location isn’t valid - meaning that
//nothing put after the teleport will fire either.
//the current location won’t be stored, either
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
oTarget=GetFirstFactionMember(oPC, FALSE);
while (GetIsObjectValid(oTarget))
{
AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionJumpToLocation(lTarget));
oTarget=GetNextFactionMember(oPC, FALSE);
}
}
I wish you like it