Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Events and Regions?
Author Message
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #1
Events and Regions?
I am trying to give a player an event so when they leave my "pre event area" it will automatically remove some tags and events etc. basically if they choose to not join the event and leave after signing up for the event so I dont have to add checks to my leave items like teleporters and moongates. Not sure what i'm doing wrong here?

Code:
.SRC.EVENTS +E_LEAVE_PRE_EVENT

[EVENTS E_LEAVE_PRE_EVENT]
ON=@RegionLeave
SRC.TAG.CURRENTEVENT=
SRC.SAY YOU LEFT A REGION.
SRC.EVENTS -E_LEAVE_PRE_EVENT
RETURN 0
ELSE
RETURN 0
ENDIF
(This post was last modified: 05-04-2012 11:44 AM by Reflex.)
05-04-2012 11:44 AM
Find all posts by this user Like Post Quote this message in a reply
Valios
Super Moderator
****

Posts: 390
Likes Given: 0
Likes Received: 12 in 9 posts
Joined: Mar 2010
Reputation: 6

Sphere Suite 2013

Post: #2
RE: Events and Regions?
(05-04-2012 11:44 AM)Reflex Wrote:  I am trying to give a player an event so when they leave my "pre event area" it will automatically remove some tags and events etc. basically if they choose to not join the event and leave after signing up for the event so I dont have to add checks to my leave items like teleporters and moongates. Not sure what i'm doing wrong here?

Code:
.SRC.EVENTS +E_LEAVE_PRE_EVENT

[EVENTS E_LEAVE_PRE_EVENT]
ON=@RegionLeave
SRC.TAG.CURRENTEVENT=
SRC.SAY YOU LEFT A REGION.
SRC.EVENTS -E_LEAVE_PRE_EVENT
RETURN 0
ELSE
RETURN 0
ENDIF

Where is your IF statement in that code to use that ELSE?
And I cannot understand why you're using "return 0" there, and twice?
Btw, you should create a function to remove the event instead.
05-04-2012 12:49 PM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #3
RE: Events and Regions?
Yea, I forgot to remove all that crap I didn't want any if statements so I could make sure it was firing.
(This post was last modified: 05-04-2012 12:54 PM by Reflex.)
05-04-2012 12:51 PM
Find all posts by this user Like Post Quote this message in a reply
Valios
Super Moderator
****

Posts: 390
Likes Given: 0
Likes Received: 12 in 9 posts
Joined: Mar 2010
Reputation: 6

Sphere Suite 2013

Post: #4
RE: Events and Regions?
".SRC.EVENTS +E_LEAVE_PRE_EVENT" that period before src doesn't help you.
Change tag for tag0 and add a reference to the region left by the player.
Remove the last 4 lines
(This post was last modified: 05-04-2012 12:57 PM by Valios.)
05-04-2012 12:56 PM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #5
RE: Events and Regions?
I know the ".SRC.EVENTS +E_LEAVE_PRE_EVENT" that period before src doesn't help you. I was just showing that I placed the event on the player... ;p

so your saying as follows... OH, and reason some of my scripts look completely weird is because I learned sphere scripting what I do know which is not much at all on 51a and everything was backasswards on 51a..
Code:
[EVENTS E_LEAVE_PRE_EVENT]
ON=@RegionLeave
REF1=<REGION> // ? OR <REGION.UID>
IF <REF1> =! <REGION.UID>
SRC.TAG0.CURRENTEVENT=
SRC.SAY YOU LEFT A REGION.
SRC.EVENTS -E_LEAVE_PRE_EVENT
RETURN 0
ENDIF

//Here is my total script...

//This is how its going to work.
//1. Player Joins Event Area by going into portal
//2. After joining event area through portal they must sign in to the event via the book.
//3. Players wont be allowed to exit event area or use stuck while they are signed up for the event. They must Sign Out of the event.
//Events
//1v1_supplied
//1v1_regular
//1v1_replacement
//2v2_supplied
//2v2_regular
//2v2_replacement
//ffa_supplied
//ffa_regular
//ctf
//colorwars
//DeathByDice
//OpenDuels
//MudWrestling


[EVENTS E_LEAVE_PRE_EVENT]
ON=@RegionLeave
SRC.TAG.CURRENTEVENT=
SRC.SAY YOU LEFT A REGION.
SRC.EVENTS -E_LEAVE_PRE_EVENT

[ITEMDEF I_EVENT_BOOK_SIGNUP] //needs placed at: 5487,1174,9,1
ID=I_BOOK_OPEN
Name=Join Tournament

ON=@Create
    ATTR=08010

ON=@DCLICK
SRC.SDIALOG d_pre_event_player_setup
return 1

[FUNCTION IsInEvent]

IF (!STRCMPI("<SRC.TAG.CurrentEvent>","None"))
SRC.TAG.CurrentEvent=<VAR.EVENT_TYPE>
src.sysmessage @1153,,1 You have joined the <SRC.TAG.CurrentEvent>
//
SRC.TAG.originalBODY=<SRC.OBODY>
SRC.TAG.originalFAME=<SRC.FAME>
SRC.TAG.originalKARMA=<SRC.KARMA>
SRC.TAG.originalKILLS=<SRC.KILLS>
SRC.FINDLAYER(layer_hand1).UNEQUIP
SRC.FINDLAYER(layer_hand2).UNEQUIP
SRC.FINDLAYER(layer_shoes).UNEQUIP
SRC.FINDLAYER(layer_legs).UNEQUIP
SRC.FINDLAYER(layer_pants).UNEQUIP
SRC.FINDLAYER(layer_shirt).UNEQUIP
SRC.FINDLAYER(layer_helm).UNEQUIP
SRC.FINDLAYER(layer_gloves).UNEQUIP
SRC.FINDLAYER(layer_ring).UNEQUIP
SRC.FINDLAYER(layer_collar).UNEQUIP
SRC.FINDLAYER(layer_half_apron).UNEQUIP
SRC.FINDLAYER(layer_chest).UNEQUIP
SRC.FINDLAYER(layer_wrist).UNEQUIP
SRC.FINDLAYER(layer_tunic).UNEQUIP
SRC.FINDLAYER(layer_ears).UNEQUIP
SRC.FINDLAYER(layer_arms).UNEQUIP
SRC.FINDLAYER(layer_cape).UNEQUIP
SRC.FINDLAYER(layer_robe).UNEQUIP
SRC.FINDLAYER(layer_skirt).UNEQUIP
SRC.FINDLAYER(layer_legs).UNEQUIP
SRC.FINDLAYER.layer_dragging.BOUNCE
SRC.FINDLAYER(layer_horse).UNEQUIP //dismount if player is mounted and save exact replica to bank. not sure how to do this and also save the entirety of the characters items to a single item for them to double click which will re-equip all their items and ride.
//Put the pack in the bank

SRC.FINDLAYER(21).ATTR=01
SRC.FINDLAYER(21).CONT=<src.findlayer(29).UID>
SRC.UPDATE
//
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","1v1 Supplied")
src.sysmessage @1153,,1 You have already joined the 1vs1 Supplied!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","1v1 Regular")
src.sysmessage @1153,,1 You have already joined the 1v1 Regular!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","1v1 Replacement")
src.sysmessage @1153,,1 You have already joined the 1v1 Replacement!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","2v2 Supplied")
src.sysmessage @1153,,1 You have already joined the 2v2 Supplied!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","2v2 Regular")
src.sysmessage @1153,,1 You have already joined the 2v2 Regular!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","2v2 Replacement")
src.sysmessage @1153,,1 You have already joined the 2v2 Replacement!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","FFA Supplied")
src.sysmessage @1153,,1 You have already joined the FFA Supplied!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","FFA Regular")
src.sysmessage @1153,,1 You have already joined the FFA Regular!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","CTF")
src.sysmessage @1153,,1 You have already joined the Capture The Flag!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","Color Wars")
src.sysmessage @1153,,1 You have already joined the Color Wars
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","Death By Dice")
src.sysmessage @1153,,1 You have already joined the Death by Dice!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","Open Duels")
src.sysmessage @1153,,1 You have already joined the Open Duels!
return 1

ELSEIF (!STRCMPI("<SRC.TAG.CurrentEvent>","Mud Wrestling")
src.sysmessage @1153,,1 You have already joined the Mud Wrestling Event!
return 1

ELSE
src.sysmessage @1153,,1 You have not been assigned to a tournament!
RETURN 1
ENDIF

//Dialog for players to join / leave tournament / view combatants /
[DIALOG d_pre_event_player_setup]
0,0
page 0
resizepic 30 41 9200 356 367
resizepic 48 51 9200 318 71
dtext 141 54 183 Tournament Signup
dhtmlgump 49 137 323 174 1 1 You are about to join a tournament. If this is a Ranked Tournament your Rank will be saved. Upon joining a tournament your character's Items and

Statistics will be saved. I.E. Fame, Karma, Kills, Etc. You may leave the tournament by Clicking Leave Tournament. You may also view your fellow combatants by clicking View

Combatants.
button 135 317 2501 2501 1 0 1
button 135 344 2501 2501 1 0 2
button 135 374 2501 2501 1 0 3
dtext 154 317 1153 Join Tournament
dtext 151 345 1153 Leave Tournament
dtext 150 375 1153 View Combatants
dtext 107 76 1153 Type:
dtext 64 96 1153 Combatants:
dtext 140 76 <def.color_lunar> <VAR.EVENT_TYPE>
dtext 138 96 <def.color_lunar> <EVAL <dVAR_EVENT_COMBATANTS>>

[DIALOG d_pre_event_player_setup text]
Tournament Signup
You are about to join a tournament. If this is a Ranked Tournament your Rank will be saved. Upon joining a tournament your character's Items and Statistics will be saved.

I.E. Fame, Karma, Kills, Etc. You may leave the tournament by Clicking Leave Tournament. You may also view your fellow combatants by clicking View Combatants.
Join Tournament
Leave Tournament
View Combatants
Type:
Combatants:

[DIALOG d_pre_event_player_setup button]
ON=0
SRC.SYSMESSAGE You choose to not join the tournament.

ON=1 //join event
IsInEvent

ON=2 //leave event
SRC.SAY 2

ON=3 //view combatants
SRC.SAY 3



[EOF]
(This post was last modified: 05-04-2012 01:50 PM by Reflex.)
05-04-2012 01:47 PM
Find all posts by this user Like Post Quote this message in a reply
Valios
Super Moderator
****

Posts: 390
Likes Given: 0
Likes Received: 12 in 9 posts
Joined: Mar 2010
Reputation: 6

Sphere Suite 2013

Post: #6
RE: Events and Regions?
I forgot to tell you something, instead of events you may use regiontype instead
05-04-2012 02:39 PM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #7
RE: Events and Regions?
Alrighty.. Well.. anyone who actually wants to answer my question and explain it with an example it would be greatly appreciated Smile
05-04-2012 03:11 PM
Find all posts by this user Like Post Quote this message in a reply
Valios
Super Moderator
****

Posts: 390
Likes Given: 0
Likes Received: 12 in 9 posts
Joined: Mar 2010
Reputation: 6

Sphere Suite 2013

Post: #8
RE: Events and Regions?
There you go:

Code:
[comment eventguide]
Go to your sphere.ini, under the "NPC/Item/Player Management" look for this line of code:

// Events related to all regions
// EventsRegion=your_event

Replace the second line to this one:

EventsRegion=r_pre_event

[defname eventplaces]
eventplace_1 Britain

[function eventstatus] // --- function to enable/disable your event
    if !(<tag0.currentevent>)
          tag0.currentevent = 1
          sysmessage Current event status: ON
  else
          tag0.currentevent =
          tag0.regiontoleave =
          sysmessage Current event status: OFF

[function regionenter]
tag0.regiontoleave = 1

[function regionleave]
tag0.regiontoleave =

[regiontype r_pre_event]

on=@enter
   if (<eval <src.tag0.currentevent>> == 1)
     if !(strcmp(<region.name>, <def.eventplace_1>))        
          src.regionenter
  endif
endif

on=@exit
   if (<eval <src.tag0.currentevent>> == 1)
     if (<eval <src.tag0.regiontoleave>> == 1)
          src.say Hey Reflex, I just left Britain!
          src.regionleave
  endif
endif
05-04-2012 05:57 PM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #9
RE: Events and Regions?
Valios thank you kind sir for the help. I know i'm a pain in the ass =\ I'm so damn tired and mind boggled right now I cant even piece together your script with what i'm trying to do.. So I think I will try to get some R & R and I will reply when I get this inserted into my current script. Thanks again. It will be a good starting point for anyone who wants to add tournaments to their shard and have staff create an event by simply typing .startevent I'll post the entire script when I'm done. If Jeem gets his auto events finished we will have a really nice system for events being automated and also a system for staff ran events.
05-04-2012 07:15 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)