Author Topic: Default House Recall Script  (Read 8616 times)

0 Members and 1 Guest are viewing this topic.

Leonardo

  • Guest
Default House Recall Script
« on: September 02, 2009, 07:07:46 am »
In the aim of having Immortals with OLC access responsible for Player Houses to easily modify/upgrade a player House Recall to the new 4D Standards, I've modified the original script adding comments to better understand what it does and easily adapt the script for any given player or house.

You'll find the script attached to this message for easy editor modification.

Players that want a House Recall must supply an Immortal with this information:

*What the item looks like in your inventory
Item shortdesc:

*What the item looks like on the ground
Item longdesc:

*Description you get when looking at the item
Item extra:

*The command you want to type to use the item
Item command:

**Teleporting messages** including examples

[Single player (must specify 3 teleporting messages)]
***NOTE: What players see when actor teleports
set 1eac_single You feel the presence of someone who's missing.

***NOTE: What actor sees when he teleports
set 1sac_single You see yourself dematerializing.

***NOTE: What players see when actor lands at destination
set 1sac_single_back You feel the presence of someone.

[Group of players (must specify 2 different messages)]
***NOTE: What players see when actor teleports
set 1eac_group %actor.name% throws a mantle over %actor.hisher% friends and disappears with them.

***NOTE: What actor sees when he teleports
set 1sac_group You throw your mantle over your friends and disappear with them.

***NOTE: What players see when actor lands at destination
set 1at_group A mantle appears from nowhere and some people emerge from it.

***NOTE: What players in actor's group see when he teleports them.
set 1sp_group %actor.name% throws %actor.hisher% mantle over your head and disappears with you.

[For questions I'm always reachable at my e-mail supplied in the Profile of this forum]

Script:
Code: [Select]
***NOTE: You have to change the ARG of COMMAND to match what players ask for
*Trigger Type: Command, Numeric Arg: 3, Arg list: home

***DEFAULT HOUSE RECALL SCRIPT***
***Please leave credit to the Script Author***
*Author: Leonardo
*Contributor: Mordecai - on the random messages system.
*Creation date: 31/05/2008
*Modified: 02/09/2009

**Standard Variables**
set sac %send% %actor%
set eac %echoaround% %actor%
set fa %force% %actor%
set ta %teleport% %actor%

**Script Variables**
***NOTE: Specify the house owner name and the name of his alts
set owner 'lionheart' 'zeus'

***NOTE: Specify the VNUM of the house ROOM the player lands to
set ahouse 1902

***NOTE: Recall VNUM
set arecall 3001

***NOTE: Dungeon VNUM or RECALL vnum for players that don't want a Dungeon protection to their item.
set adungeon 1901

***NOTE: The room where Newbies land if using the item.
set aseekers 12900

***NOTE: The Crash-Proof room VNUM of the player house
set aproof 1900


**Register Player to use the recall item**
if %arg.car%==register && %owner.contains('%actor.name%')%
if !%arg.cdr%
  %sac% You have to specify the name of the player.
  halt
  end
  set aplayer %arg.cdr%
  set people %actor.people%
  while %people%
    set next %people.next_in_room%
    if %people%==%aplayer%
      set aplayer %people%
    end
    set people %next%
  done
  if %aplayer.is_pc%
***NOTE: Change the player-house FLAG always use: playername_house_access as flag.
    if !%aplayer.varexists(LION_HOUSE_ACCESS)%
***NOTE: Change the player-house FLAG always use: playername_house_access as flag.
    set LION_HOUSE_ACCESS 1
***NOTE: Change the player-house FLAG always use: playername_house_access as flag.
    remote LION_HOUSE_ACCESS %aplayer.id%
    %sac% %aplayer% has been registered to use %self.shortdesc%.
    %send% %aplayer% %actor.name% authorized you to use %self.shortdesc%.
    halt
  else
***NOTE: Change the player-house FLAG always use: playername_house_access as flag.
  rdelete LION_HOUSE_ACCESS %aplayer.id%
  %sac% %aplayer% removed from %self.shortdesc% access list.
  %send% %aplayer% %actor.name% unauthorized you to use %self.shortdesc%.
  halt
  end
  else
   %sac% Sorry your friend isn't here.
   halt
  end
else
end

**Let players load a new Recall Item paying 1 Silver Token
if %arg.car%==load && %owner.contains('%actor.name%')%
  set av %actor.inventory%
  while %av%
***NOTE: The VNUM of a silver token 
    if %av.vnum%==3302
      %load% obj %self.vnum% %actor% inv
      %purge% %av%
      %sac% You loaded %self.shortdesc% at the cost of 1 Silver Token.
      halt
    else
      set av %av.next_in_list%
    end
  done
  %sac% No silver tokens found in your Inventory. Try again.
  halt
end

**Script messages**
*Misc
set athere {ccThe magic dissolves as it has no use.{cx
set aprot {crThe wrath of {cW%owner.car% {crdescends upon {cR%actor.name%{cr.{cx
*Single player
***NOTE: What players see when actor teleports
set 1eac_single You feel the presence of someone who's missing.

***NOTE: What actor sees when he teleports
set 1sac_single You see yourself dematerializing.

***NOTE: What players see when actor lands at destination
set 1sac_single_back You feel the presence of someone.

set 2eac_single %actor.name% strikes a lighting bolt to the ground and disappears.
set 2sac_single You strike a lighting bolt to the ground and disappear.
set 2sac_single_back A lighting bolt strikes the ground and %actor.name% appears.

set 3eac_single With a subtle movement %actor.name% covers %actor.himher%self with %actor.hisher% mantle and disappears.
set 3sac_single With a subtle movement you enter the room.
set 3sac_single_back With a subtle movement %actor.name% reveals %actor.himher%self from under %actor.hisher% mantle.
*Messages number
set msgsingle 3
*Group of players
***NOTE: What players see when actor teleports
set 1eac_group %actor.name% throws a mantle over %actor.hisher% friends and disappears with them.

***NOTE: What actor sees when he teleports
set 1sac_group You throw your mantle over your friends and disappear with them.

***NOTE: What players see when actor lands at destination
set 1at_group A mantle appears from nowhere and some people emerge from it.

***NOTE: What players in actor's group see when he teleports them.
set 1sp_group %actor.name% throws %actor.hisher% mantle over your head and disappears with you.

set 2eac_group A dimensional vortex materialize - %actor.name% and %actor.hisher% group jumps in it.
set 2sac_group A dimensional vortex materialize - You jump in it.
set 2at_group A dimensional vortex materialize - some people emerge from it.
set 2sp_group A dimensional vortex materialize - You follow %actor.name% in it.
*Messages number
set msggroup 2
**Script START**
if %actor.fighting%
  %sac% You can't concentrate enough!
  halt
end
%sac% You grab %self.shortdesc%.
wait 5s
if %actor.is_npc%
  set actor %actor.master%
  %echo% Uff %actor.name%, this trick is old - where's your creativity?
  %eac% %aprot%
  %teleport% %actor% %adungeon%
  %force% %actor% look
  eval agold %actor.gold%
  %force% %actor% donate %agold%
  nop %actor.gold(-%agold%)%
  %purge% self

***NOTE: Change the player house FLAG here too.
elseif !%owner.contains('%actor.name%')% && !%actor.varexists(LION_HOUSE_ACCESS)%
  *Newbies Protection
  if %actor.clanname%==Seekers
    %eac% %aprot%
    %ta% %aseekers%
    %fa% look
    wait 1s
    %sac% Be careful when you use this item next time, it might not be so easy to get out then.
    %purge% self
    halt
  else
    *Remorted Player Consequences
    %send% %actor% {cWNow THAT was a very dumb thing to do!{cx
    %eac% %aprot%
    %ta% %adungeon%
    %fa% look
    eval agold %actor.gold%
    %force% %actor% donate %agold%
    nop %actor.gold(-%agold%)%
    %purge% self
    drop all
    halt
  end
end
if !%arg%
  if %actor.room.vnum%==%ahouse% || %actor.room.vnum%==%aproof%
    %sac% %athere%
    halt
  end
  eval chance %%random.%msgsingle%%%
  eval msg1 %%%chance%eac_single%%
  eval msg2 %%%chance%sac_single%%
  eval msg3 %%%chance%sac_single_back%
  %eac% {cc%msg1%{cx
  %sac% {cc%msg2%{cx
  %ta% %ahouse%
  %eac% {cc%msg3%{cx
  %fa% look
elseif %arg%==recall
  if %actor.room.vnum%==%arecall%
    %sac% %athere%
    halt
  end
  eval chance %%random.%msggroup%%%
  eval msg1 %%%chance%eac_group%
  eval msg2 %%%chance%sac_group%
  eval msg3 %%%chance%at_group%
  eval msg4 %%%chance%sp_group%
  %sac% {cc%msg2%{cx
  %at% %arecall% %echo% {cc%msg3%{cx
  set people %actor.people%
  while %people%
    set next %people.next_in_room%
    if %people.master%==%actor%
      %send% %people% {cc%msg4%{cx
      %teleport% %people% %arecall%
      %force% %people% look
    end
    set people %next%
  done
  %eac% {cc%msg1%{cx
  %teleport% %actor% %arecall%
  %force% %actor% look
elseif %arg%==group
  if %actor.room.vnum%==%ahouse%
    %sac% %athere%
    halt
  end
  eval chance %%random.%msggroup%%%
  eval msg1 %%%chance%eac_group%
  eval msg2 %%%chance%sac_group%
  eval msg3 %%%chance%at_group%
  eval msg4 %%%chance%sp_group%
  %sac% {cc%msg2%{cx
  %at% %ahouse% %echo% {cc%msg3%{cx
  set people %actor.people%
  while %people%
    set next %people.next_in_room%
    if %people.master%==%actor%
      %send% %people% %msg4%
      %teleport% %people% %ahouse%
      %force% %people% look
    end
    set people %next%
  done
  %eac% {cc%msg1%{cx
  %teleport% %actor% %ahouse%
  %force% %actor% look
else
***NOTE: Change the command name in the helpfile to match player preference.
  %sac% Commands List:
  %sac% - {cchome{cx (teleports you to Lionheart's Hiding Place)
  %sac% - {cchome {cWRECALL{cx (teleports YOU and your GROUP to Recall Point)
  %sac% - {cchome {cWGROUP{cx (teleports YOU and your GROUP to Lionheart's Hiding Place)
  %sac% - {cchome {cWREGISTER{cx (Authorize a player to use this Recall Item){cr*{cx
  %sac% - {cchome {cWLOAD{cx (Loads a new Recall Item if you have a Silver Token in your inventory){cr\*{cx
  %sac% - {cr\*Only the item owner can use this command.{cx
end
***NOTE: If you left the script Intact and modified just the fields suggested with the '***NOTE:' comment, the script will work smoothly.

« Last Edit: September 02, 2009, 07:16:26 am by Leonardo »

Leonardo

  • Guest
Re: Default House Recall Script
« Reply #1 on: September 24, 2009, 09:59:40 pm »
I made a new topic about this in the scripting board. Why can't I delete this topic though?