SphereCommunity
Home Home Home - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: Home Home Home (/Thread-Home-Home-Home)



Home Home Home - Ultima One - 05-16-2013 12:56 AM

Time to share some scripts we use frequently on TUP. Some may be in need of updating.

This script allows a player to set their 'Home' town, and provide each town with a population value.

Use: Place a stone in each town you want people to be able to go back to if they are dead. Update the default location at the bottom. Add the 'home home home' speech event to all players.

Use: say 'home home home' to go back to your home town.

Code:
[itemdef i_home_stone]
Name= Home Stone
ID=i_guildstone
Type=T_Normal

On=@Create
   color=007a3

// Remove if
On=@Click
    SAY Population:  <TAG.POPULATION>
    RETURN 1
  
on=@Dclick
    IF (<SRC.ISGM>)
        RETURN 1
    ENDIF
    IF (STRMATCH(<SRC.TAG.HOMETOWN>,<REGION.NAME>))
        SRC.SYSMESSAGE You are already a citizen of this town.
    ELSE
        TAG.POPULATION = <<TAG.POPULATION> + 1>
       SRC.SYSMESSAGE You have changed your home town to <REGION.NAME>
       SRC.TAG.HOME = <EVAL (<P.X>+2)>,<P.Y>,<P.Z>,<P.M>
       SRC.TAG.HOMETOWN =  <REGION.NAME>
     ENDIF
   return 1
  
  
// Add to player speech event
ON=home home home
IF ( <FLAGS> & statf_freeze )
    SYSMESSAGE You can't do that in your current state.
    RETURN 1
ELSEIF ( <FLAGS> & statf_war )
    SYSMESSAGE You can't do that when in warmode.      
    RETURN 1
ELSEIF ( <FLAGS> & statf_stone )
    SYSMESSAGE You can't do that in your current state.
    RETURN 1
ELSEIF ( <REGION.FLAGS> & region_antimagic_all )
    SYSMESSAGE You can't do that from here.
    RETURN 1
ELSEIF (<REGION.FLAGS> & region_antimagic_recall_out)
    SYSMESSAGE You can't do that from here.
    RETURN 1
ENDIF
IF ( <FLAGS> & statf_dead )
    IF (<tag.home>)
    go <tag.home>
    ELSE
    go 1946,2702,20,0 //default location
    ENDIF
endif