You are here

Jump to Party Leader Script by Converstion From NPC

3 posts / 0 new
Last post
LOBSTER
Jump to Party Leader Script by Converstion From NPC

Hello scripters :)

I would like to ask for a hand with a condition/check script

what I would like is a script that checks that you have specific item in your backpack to work if not it gives you a message that you are missing this item.

When a PC talks to a NPC and asks "jump to party leader" I want the npc converstion scripts to check if the person has this item in there backpack so that they are allowed to jump to the party leader, becuase the area that the leader is in "requires an item to pass through the transition door".

if the player that wants to join to leader does not have this item the PC will not be allowed to join or jump to him without having the key in.. to get into the area.

I would like to stop players from jumping into harder areas which are in partys, without doing the low areas and getting the keys to step up to get to the harder areas and not missing them.

there will be another script i would like to ask but for now I would like to have this one work.

 

L0BSTER

  • up
    50%
  • down
    50%
Mannast

LOBSTER, I made this an OnAction script instead of a conditional because you want it to occur when the oPC makes the choice to travel on in the conversation.
----------------------------------------
void main()
{
// Get the PC who is involved in this conversation
object oPC = GetPCSpeaker();
object oNPC = OBJECT_SELF;
string sRequired = "mcguffin_tag";//Change this to the tag of the required item
object oItem = GetItemPossessedBy(oPC, sRequired);

if(oItem == OBJECT_INVALID)
{
SendMessageToPC(oPC, "You need to possess the McGuffin to move on.");
//Change McGuffin to name of required item
return;//Don't have the item - then the script ends here.
}

//Now we want the speaker to jump to the Party leader - this is found by Faction
object oLeader = GetFactionLeader(oPC);

//If the oPC is the party leader, they need to go on too.
string sJump = GetLocalString(oNPC, "JumpWP");//This can be the tag of the starting location in the next area
object oJump = GetObjectByTag(sJump);//This gets the waypoint
//if there is no target, the leader won't get transferred - it can be a waypoint, door, or any other object with a tag.

if(oLeader == oPC)
{
SendMessageToPC(oPC, "You are the leader of your party and may travel on.");
}

else
{
SendMessageToPC(oPC, "You may travel on and follow your party leader.");
oJump = oLeader;//If the oPC is not the leader, then the oLeader is the target of the jump
}

//Do the jump
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToObject(oJump));
}

Portable Hole System, Scry and Teleport System, Throwing Objects, Prodding Traps, Portable Placeables and a Vanilla Basemodule, among other things

  • up
    50%
  • down
    50%
LOBSTER

Sweet Thank you!! :)

this is great help and is needed hehe

L0BSTER

  • up
    50%
  • down
    50%