Main

DS Systems:
Locator/Ranger Finder
Object/Floor Management
Dream Time/Weather
SafeTiles / LifeTiles
Barebones Database
ID Code in a Nutshell

Furcadia Links:

Furcadia Site
Furcadia Forums

Resource Links:

Simon Potter's Front Page
Dreamless Dancer's Front Door
Mystic Land's Tutorials

Downloads:

Utilities:
Graphite's PatchMerger
Public Dreams:
Furcadia Historical Society
Nommad's Dream Downloads:

SpaceQuest
ClanWars
SpiritQuest
NeverQuest (The Bard's Tail)
Barebones Database Dream

Play Furcadia!

DragonSpeak Systems
"Entry Code Stats & PvP System"


This is a break-down with commentary of a "Quick Stats PvP System" I'm working on.
My intent is that it can be used as a Tutorial on Variables from the basic concepts to advanced concepts and how they can be applied to create an interactive environment into a dream.
The Tutorial is a functional dream you can download with all the patches and sound for the special effects and weapons since I believe experiencing the code in action is the best way to see how the code actually works.
The Dream is divided into 3 Main sections and a "Bonus" Duel Arena code.
The green text is the tutorial commentary of the DragonSpeak codes and variables that follow.

Download Dream Here

Startup and Timers - Dream Entry and Stats - Attack Code - Duel Arena

Getting Started with Variables, Animations, and Special FX:

First you'll have to be comfortable with Variables. A variable is basically a special word marked with a % that stores a number.
Sometimes that number will represent an Object, Floor, Wall or something like Hitpoints or an Attack. Don't let them intimidate you and you'll be able to use them on your own in alot of different ways.
I use alot of variables but try and name them in such away that it's fairly easy to see what the number is being used for and how to modify it through DS.


DSPK V04.00 Furcadia
New Dragonspeak Script
Created by  Nommad

*Entry Code "Quick Stats" & PvP System by Nommad

*I made this startup section so some "special" objects and floors could be easily changed.... and a fairly simple example and use of variables.
*As you can see, all a variable is, is a word or name to represent a number, and with the variable %theme it is a random number 100, 101, 102.
*These variables will be used for special effects or to set up conditions and randomize "Theme" music that plays.

(0:0) When everything is starting up,
            (5:300) set variable #%duel to the value #0.
            (5:300) set variable #%safetile to the value #143.
            (5:300) set variable #%scoreitem to the value #614.
            (5:300) set variable #%damagefx to the value #145.
            (5:312) set variable #%theme to the total of rolling #1 dice with #3 sides plus #99.


*Animations and Special FX

*I typically have most of my special effects on offset timers.
*1 second offsets I use for fighting, magic, explosion effects as well as most cycling animations and randomizing.
*I've started using Walls for most fighting and magic effects which is a little awkward to patch and use.
*The Actual Wall Numbers and object numbers seem really screwy and is worth a tutorial all in itself.
*Anyway I made a custom Wall patch with more than enough effects to get started with.

*cycle / clear fx
*This block manages animations as well as clearing out the "end" object of effects like attacks or magic.
(0:100) When #1 seconds have passed, offset by #0,
*always be sure to specify a location even if it's everywhere...
      (3:1) everywhere on the whole map,
*healing animation
            (5:62) change wall shape #9 with texture #10 to shape #0 with texture #10.
            (5:62) change wall shape #10 with texture #10 to shape #9 with texture #10.
*lighting animation
            (5:62) change wall shape #7 with texture #10 to shape #0 with texture #10.
            (5:62) change wall shape #8 with texture #10 to shape #7 with texture #10.
*explosion animation
            (5:62) change wall shape #5 with texture #10 to shape #0 with texture #10.
            (5:62) change wall shape #6 with texture #10 to shape #5 with texture #10.
*attack animation
            (5:62) change wall shape #3 with texture #10 to shape #0 with texture #10.
            (5:62) change wall shape #4 with texture #10 to shape #3 with texture #10.

*I use some objects for special effects too so this animates clears the "collateral damage" object
            (5:5) change object type #%damagefx to type #0.
*animates a fire
            (5:6) swap object types #1000 and #1001.
*Another basic variable  that constantly randomizes the music files m100-m102 for the next time it is triggered
            (5:312) set variable #%theme to the total of rolling #1 dice with #3 sides plus #99.

*light a fire
(0:3) When somebody moves into object type #79,
            (5:5) change object type #79 to type #1000.

*Clean-Up
*This is a handy section to put into your dream to take care of any stray objects left over or that need to be restored.
*This simply turns off any burning fires every 5 minutes. (300 seconds = 5 minutes)
*5 minute clean-up
(0:100) When #300 seconds have passed, offset by #0,
      (3:1) everywhere on the whole map,
            (5:5) change object type #1000 to type #79.
            (5:5) change object type #1001 to type #79.

*This cleans up all the stray weapons that may have accumulated in an Hour. (3000 seconds = 1 hour)
*1 hour clean-up
(0:100) When #3000 seconds have passed, offset by #0,
      (3:1) everywhere on the whole map,
            (5:5) change object type #2401 to type #0.
            (5:5) change object type #2402 to type #0.
            (5:5) change object type #2403 to type #0.
            (5:5) change object type #2404 to type #0.
            (5:5) change object type #2405 to type #0.

*This ends the Startup and Special FX section of the Code





Dream Entry and Stats Setup:

Okay, I know some of that might be a little confusing, but hopefully it will be come more clear.
Think of it as sort of a warm up in Variables and Randomness.
Now I deal with a Furre Entering the Dream and "Tag" them with an Entry Code and set up their Stat variables.

*============ "Quick Stats" =====================================

*Since this is a PvP Dream I want to track hp and score. I typically like to give everyone 100 hp, so I set everyone's code to 100.

(0:9) When a furre arrives in the dream,
            (5:316) set the triggering furre's entry code to #100.
*give the new furre the starting weapon (see weapons and attack code)
            (5:76) place object type #2401 in the triggering furre's paws.
            (5:15) move the triggering furre to (#20,#20), or to someplace nearby if it's occupied.
*play random entry music
            (5:30) play midi #%theme to the triggering furre.
            (5:200) emit message {<b>Entry Code "Quick Stats" PvP System</b> <i>by Nommad</i>} to the triggering furre.

*I stacked this for a sort of Info emit that displays when a Furre Enters the Dream, types ?, or Bumps a Sign.
(0:9) When a furre arrives in the dream,
(0:31) When a furre says {?},
(0:3) When somebody moves into object type #272,

            (5:200) emit message { } to the triggering furre.
            (5:200) emit message {Say S for STATS to view Hp, Score, and Weapon.} to whoever set off the trigger.
            (5:200) emit message {Bump a Statue to get a Random Weapon.} to the triggering furre.
            (5:200) emit message {F3 facing another Player or Target to Attack.} to whoever set off the trigger.
            (5:200) emit message {Attacks on Safetiles ("clicking" floors) always Miss.} to the triggering furre.
            (5:200) emit message {Bump Gravestones left from PvP Frags to Score.} to whoever set off the trigger.
            (5:200) emit message {An Arena for Duels is directly South.} to whoever set off the trigger.

*This is where you setup all the different variables for the players interaction with the dream.
*I don't need all of these for the dream, but you do need to include any action that might have an effect on a variable.
(0:9) When a furre arrives in the dream,
(0:1) Whenever somebody moves,
(0:11) When a furre stands up,
(0:12) When a furre sits down,
(0:13) When a furre lays down,
(0:16) When a furre uses any object,
(0:30) When a furre says anything,
(0:33) When a furre poses/emotes anything,
(0:36) When a furre says or emotes anything,
(0:39) When a furre emits anything,
(0:71) When a furre stays in the same square for #1 seconds,

*First put the Furre's entry code into a variable to set the players stats.
            (5:315) set variable #%stats to the triggering furre's entry code.
*I copy this variable into another variable to do the math.
            (5:300) set variable #%code to the value #%stats.
*The Second Stat (Score) is based on 1000... 1000 = 1 point. So Dividing code by 1000 gives you the Score (%code) and what's left are Hp.
            (5:308) divide variable #%code by #1000 and put the remainder in variable #%hp.
*Here you can set alot of other variables for what a player is holding, the object, floor, and wall they are at, etc...
            (5:317) set variable #%paws to the number of the object in the triggering furre's paws.
            (5:350) set variable #%player to the X,Y position the triggering furre (moved from/is standing at).
            (5:380) set variable #%floor to the floor type at (#%player).
            (5:381) set variable #%object to the object type at (#%player).
            (5:382) set variable #%wall to the wall shape at (#%player).
            (5:383) set variable #%texture to the wall texture at (#%player).
*It also sets up the "Origin" to determine a Target in the Attack Code Section.
            (5:301) copy the value of variable #%player into variable #%target.

*Simple commands that emit the Stat Variables.
(0:31) When a furre says {s},
(0:31) When a furre says {stats},
            (5:200) emit message {STATS: Hp: %hp / Score: %code} to whoever set off the trigger.

*This ends the Entry and Stat Setup Code




Weapons, Targeting, and Attack Code:
For the sake of simplicity I've only included "Melee" attacks which will only target the space in front of the triggering furre.
There are also alot of different ways to setup your weapons. I've chosen to use a little math trick to use the actual object number as part of the formula for attack damage.


*=============================================== Weapons ================
*Place Weapons / Get Random Weapons
*I always use custom patches for my weapons, but this time decided to use the actual object number of the weapons to determine it's damage.
*A little match and a few Variables and I can make these numbers to alot of different things....

*There are alot of different ways to get the weapons to the player.
*I've used when a furre moves into a floor type....

(0:2) When somebody moves into floor type #143,
*randomize which weapon the player will get. There are 5 available weapons. This math with make the variable %weapon = object 2401-2405.
            (5:312) set variable #%weapon to the total of rolling #1 dice with #5 sides plus #2400.
      (3:6) where the triggering furre moved into,
*places the object where they moved into.
            (5:4) place object type #%weapon.
*this is the base attack of all weapons... subtracting 2400 will give back the Weapon Number or Power of the Weapon.
            (5:304) take variable #%weapon and subtract #2400 from it.
*and as long as you've done the math you can put a quick little emit telling the Furre which Weapon he's found.
            (5:200) emit message {Weapon #%weapon is at Your Feet. F2 to Equip it.} to the triggering furre.
*and to add just a little more flavor add a sound.... there are lots of good default sounds...
            (5:11) play sound #23 to every furre who can see the triggering furre.

*Pretty much the same as above except this one you're moving into an unwalkable object and places the weapon where the Furre is.
*This one there are 4 possible locations to trigger it, where as the one above there is only one location.

(0:3) When somebody moves into object type #43,
(0:3) When somebody moves into object type #44,
            (5:312) set variable #%weapon to the total of rolling #1 dice with #5 sides plus #2400.
      (3:5) where the triggering furre (moved from/is standing at),
            (5:4) place object type #%weapon.
            (5:304) take variable #%weapon and subtract #2400 from it.
            (5:200) emit message {Weapon #%weapon is at Your Feet. F2 to Equip it.} to the triggering furre.
            (5:11) play sound #23 to every furre who can see the triggering furre.


*This adds to the "stats" emit if the player is holding a weapon and emits which weapon and it's Damage Range.
*There are many ways to setup weapon power, this time I decided to use the actual object number to set the weapon power.
*I use a custom patch and Weapon 1 is object #2401.
(0:31) When a furre says {s},
   (1:201) and variable #%paws is greater than #2400,
(0:31) When a furre says {stats},
   (1:201) and variable #%paws is greater than #2400,

            (5:301) copy the value of variable #%paws into variable #%attack.
            (5:304) take variable #%attack and subtract #2400 from it.
*This variable maxattack is only used here as a way to emit the damage range of the weapon.
            (5:300) set variable #%maxattack to the value #%attack.
*I chose 10 to be the "Base" Damage of all weapons and here the variable attack is the weapon power.
*I'll talk more about weapon power and attack damage in the Attack Code section.
            (5:306) multiply variable #%maxattack by #10.
            (5:200) emit message {Weapon %attack : %attack - %maxattack damage} to whoever set off the trigger.

*Just a little extra effect sound when a player picks up a weapon.

(0:17) When somebody picks up object type #2401,
(0:17) When somebody picks up object type #2402,
(0:17) When somebody picks up object type #2403,
(0:17) When somebody picks up object type #2404,
(0:17) When somebody picks up object type #2405,
            (5:11) play sound #99 to every furre who can see the triggering furre. (custom sound not default sound)
            (5:200) emit message {You Equip a Weapon. F3 to Attack. ? for More Info.} to the triggering furre

*================================================= Attack Code ========
*It's always a good idea to have an area where there can be no PvP attacking like the Dream Entry and Graveyard areas.
*This is typically done by using a "Safetile". I've set it up so all tiles equal to or greater than %safetile are safetiles.
*This allows me to use a variety of tiles in safe areas. I also use a subtle click to indicate Safe - No PvP tiles.
(0:1) Whenever somebody moves,
   (1:200) and variable #%floor is equal to #%safetile,
(0:1) Whenever somebody moves,
   (1:201) and variable #%floor is greater than #%safetile,
            (5:11) play sound #20 to every furre who can see the triggering furre.

*Attack values are set based on what is in the players paws.
*The attack code / math system uses the iteme.fsh file starting with item 2401, so by subtracting 2400 from the variable paws,
*The new number can be used as a multiplier for Weapon Damage. To insure a player does not inflict negative damage and "heal" thier target,
*A base attack value is set for weaponless attacks. Here I've made weaponless attacks range from 1-5 damage.
(0:16) When a furre uses any object,
   (1:202) and variable #%paws is less than #2401,
            (5:312) set variable #%attack to the total of rolling #1 dice with #5 sides plus #0.

*This is where you determine if a player is holding a weapon, which weapon and randomize the amount of damage, within the weapon's range.
*In this Code the Damage Range for each weapon is it's Multiplier value (paw object - 2400) x 10.
*It also includes an fx sound #100 for swinging a weapon.
(0:16) When a furre uses any object,
   (1:201) and variable #%paws is greater than #2400,
            (5:301) copy the value of variable #%paws into variable #%attack.
            (5:304) take variable #%attack and subtract #2400 from it.
            (5:312) set variable #%attack to the total of rolling #%attack dice with #10 sides plus #0.
            (5:11) play sound #100 to every furre who can see the triggering furre.


*========================================= Targeting Code ======
*Now you need code to determine where the target is, and what it is, and if it's a legal target.
*The Origin of the variable %target has already been set, so now all you have to do is move it to the target location.
*For melee attacks you simply move the position one space the furre is facing and store the object and floor numbers into variables.

(0:16) When a furre uses any object,
   (1:13) and the triggering furre is facing northeast (up and right),
            (5:352) move the position in variable #%target northeast (up and right) #1 step(s).
            (5:380) set variable #%targetfloor to the floor type at (#%target).
            (5:381) set variable #%targetobject to the object type at (#%target).
(0:16) When a furre uses any object,
   (1:14) and the triggering furre is facing southeast (down and right),
            (5:353) move the position in variable #%target southeast (down and right) #1 step(s).
            (5:380) set variable #%targetfloor to the floor type at (#%target).
            (5:381) set variable #%targetobject to the object type at (#%target).
(0:16) When a furre uses any object,
   (1:15) and the triggering furre is facing southwest (down and left),
            (5:354) move the position in variable #%target southwest (down and left) #1 step(s).
            (5:380) set variable #%targetfloor to the floor type at (#%target).
            (5:381) set variable #%targetobject to the object type at (#%target).
(0:16) When a furre uses any object,
   (1:16) and the triggering furre is facing northwest (up and left),
            (5:355) move the position in variable #%target northwest (up and left) #1 step(s).
            (5:380) set variable #%targetfloor to the floor type at (#%target).
            (5:381) set variable #%targetobject to the object type at (#%target).


*========================================= Damage Code =======
*vs object I have a "Weapon Check"
*it's always good to have something in the dream to test the actual attacks.
*Since I use the greater than less than system combined with %targetobject I can use a range of objects.
*I've chosen a range that will allow a "weapon check" for virtually every item without destroying it.

(0:16) When a furre uses any object,
   (1:201) and variable #%targetobject is greater than #0,
   (1:202) and variable #%targetobject is less than #1002,
*I add a "Hit" sound...
            (5:11) play sound #101 to every furre who can see the triggering furre.
*an emit that shows the damage roll...
            (5:200) emit message {Weapon Check: %attack Damage.} to the triggering furre.
*and use an animated wall for a special visual effect that creates a sort of layer on the object.
      (3:2) at position (#%target). on the map,
            (5:44) place wall shape #10 with texture #10

*vs object  - "Colateral Damage"
*Again using the variable for a range of objects, I create a "colateral damage" effect.
(0:16) When a furre uses any object,
   (1:201) and variable #%targetobject is greater than #1031,
   (1:202) and variable #%targetobject is less than #1056,
*what ever object falls within the range is changed to the animated damagefx object
            (5:41) place object type #%damagefx at (#%target).
            (5:11) play sound #41 to every furre who can see the triggering furre.
            (5:200) emit message {Attack for %attack Damage.} to the triggering furre.
      (3:2) at position (#%target). on the map,
            (5:44) place wall shape #10 with texture #10

*Colateral Damage Repair
*In this dream object 1032 is the only object that takes collateral damage. I "repair" it every 5 minutes using a floor filter.
(0:100) When #300 seconds have passed, offset by #0,
         (4:1) only where the floor is type #19,
            (5:4) place object type #1032.

*=================== PvP Damage / Furre vs Furre
*Damage is dealt instantly, but determining if the target was killed has to be checked using a 1 second offset in the next block of code..
(0:16) When a furre uses any object,
*first check for a furre at the target location....
   (1:1100) and there's a furre at (#%target),
*then, checking to be sure they are standing at wall 0 prevents spamming hits since the Hit FX is a wall.
   (1:1015) and position (#%target), is wall shape #0,
*finally check to be sure it's a valid location to attack
   (1:202) and variable #%targetfloor is less than #%safetile,

*then make the target furre become the triggering furre to deal the damage
            (5:51) make any furre standing at (#%target) become the new triggering furre.
*get the target furre's stats/hp/score and put them into variables.
            (5:315) set variable #%stats to the triggering furre's entry code.
            (5:308) divide variable #%stats by #1000 and put the remainder in variable #%hp.
*subtract the damage.
            (5:304) take variable #%hp and subtract #%attack from it.
*then, rebuild the stat variables back into the entry code.
            (5:306) multiply variable #%stats by #1000.
            (5:302) take variable #%stats and add #%hp to it.
            (5:316) set the triggering furre's entry code to #%stats.
            (5:203) emit message {[FURRE] takes %attack Damage!} to whoever every furre who can see the triggering furre.
*and place the special effects and play a hit sound
      (3:7) whereever the triggering furre was at when the trigger activated,
            (5:44) place wall shape #10 with texture #10
            (5:11) play sound #101 to every furre who can see the triggering furre.

*================================ PvP Kill Code =============
*Since you can't add a condition to check for death after the (5:51) effect you have to use a 1 second offset to make the check.
*This is a special case scenario I discovered during testing and must be checked before you check for less than 0 hp.
*When the attack is greater than the target's hp and the target's score is greater than 0.
*The math will will take 1 way from the score and a 900 will be moved into the hp variable.
(0:71) When a furre stays in the same square for #1 seconds,
*check to see if hp are greater than the max hp of 100.
   (1:201) and variable #%hp is greater than #100,

      (3:7) whereever the triggering furre was at when the trigger activated,
*place the "score" item.
            (5:4) place object type #%scoreitem.
            (5:204) emitloud message {[FURRE] has been Fragged.} to everyone on the map.
            (5:203) emit message {Move into the Gravestone to Score the Frag.} to every furre who can see the triggering furre.
*do this math to save any score above the 1 that was lost...
            (5:306) multiply variable #%code by #1000.
*then restore the lost Score and reset hp to 100.
            (5:302) take variable #%code and add #1100 to it.
*restore the entry code.
            (5:316) set the triggering furre's entry code to #%code.
*move the furre to the graveyard.
            (5:15) move the triggering furre to (#20,#22), or to someplace nearby if it's occupied.
            (5:12) play sound #62 to everyone on the map.

*This is basically the same thing for a Furre that has a score of 0, or damage makes there hp equal 0 or drop below 1.
(0:71) When a furre stays in the same square for #1 seconds,
*this line prevents a player entering the dream from triggering the Kill Code.
   (1:201) and variable #%player.x is greater than #0,
   (1:202) and variable #%hp is less than #1,

      (3:7) whereever the triggering furre was at when the trigger activated,
            (5:4) place object type #%scoreitem.
            (5:204) emitloud message {[FURRE] has been Fragged.} to everyone on the map.
            (5:203) emit message {Move into a Gravestone to Score.} to every furre who can see the triggering furre.
*this is for players who have a score and hp equal 0 so their current score is saved into the entry code.
            (5:306) multiply variable #%code by #1000.
*this line restores hp to 100.
            (5:302) take variable #%code and add #100 to it.
*rebuild the entry code.
            (5:316) set the triggering furre's entry code to #%code.
*move the furre to the graveyard.
            (5:15) move the triggering furre to (#20,#22), or to someplace nearby if it's occupied.
            (5:12) play sound #62 to everyone on the map.

* ===================== Healing
*This code saves the score and resets the hp stat to max 100. Variations of this could be used for healing potions or med kits.
(0:3) When somebody moves into object type #149,
            (5:306) multiply variable #%code by #1000.
            (5:302) take variable #%code and add #100 to it.
            (5:316) set the triggering furre's entry code to #%code.
      (3:5) where the triggering furre (moved from/is standing at),
            (5:44) place wall shape #4 with texture #10
            (5:11) play sound #102 to every furre who can see the triggering furre.
            (5:200) emit message {Your Hitpoints have been Restored.} to the triggering furre.

* ===================== Scoring
*This system for scoring PvP kills is a little bit crude but works. When a player is killed or dies they leave a gravestone object.
*Any player that moves into that object, clears the objects and scores.
(0:3) When somebody moves into object type #%scoreitem,
      (3:6) where the triggering furre moved into,
            (5:4) place object type #0.
            (5:302) take variable #%stats and add #1000 to it.
            (5:316) set the triggering furre's entry code to #%stats.
            (5:204) emitloud message {[FURRE] Claims the Frag!} to everyone on the map.

*==================== Winning
(0:71) When a furre stays in the same square for #1 seconds,
* Since I am using the Entry Code to record each players score, I have to limit the max score to a number below 30 (x 1000 = 30000).
*The number here determines when the "Score" stats are reset. For this example I use 15 as the max score.
*So, 14999 will force a reset when any player has a score of 15.
   (1:201) and variable #%stats is greater than #14999,
            (5:204) emitloud message {[FURRE] has Won the Match!} to everyone on the map.
            (5:12) play sound #64 to everyone on the map.
            (5:300) set variable #%match to the value #1.

*======================= Reset
*While the %match variable is equal to 1 or "true" it resets the entry codes of each furre.
(0:71) When a furre stays in the same square for #1 seconds,
   (1:200) and variable #%match is equal to #1,
            (5:316) set the triggering furre's entry code to #100.

*Move all Furre's to the Beginning of the Dream
*Since this offset sets the %match variable to 0 or "false" it uses a 2 second delay.
(0:100) When #2 seconds have passed, offset by #0,
   (1:200) and variable #%match is equal to #1,
      (3:1) everywhere on the whole map,
            (5:17) move any furre present to (#25,#25), or to someplace nearby if it's occupied.
            (5:5) change object type #%scoreitem to type #0.
            (5:204) emitloud message {A New Match has Begun!} to everyone on the map.
            (5:300) set variable #%match to the value #0.
            (5:31) play midi #%theme to everyone on the map.

*This is the end of Core PvP and Stat System



Duel Arena:
As a "Bonus" I've included the code for a Duel Arena.

*This is were you would insert Dream Specific Code for things like Dueling, Capture the Flag, King of the Hill, etc.
*I've included a Duel Arena which works to match weapons for fairness and prevent interference from other players.
*Take note there is small "Final Code" that must be included right before the *End Triggers* line of the DS file.

*=============================== Duel Arena Add-On ==============

*A Simple Sign
(0:3) When somebody moves into object type #271,
            (5:200) emit message {=== Duel Arena ===} to the triggering furre.
            (5:200) emit message {When 2 Furres have entered the Arena Random Identical Weapons are Automatically Equipped for the Fighters. The Duel automatically starts a 2 Minute Timer that Resets the Arena if there is no Winner or One of the Players has left the Dream.} to the triggering furre.

*I use a "special" tile for the duel arena to use as a trigger when a person enters the arena.
(0:2) When somebody moves into floor type #9,
*I also use an object so I can trigger a "lock" for the arena.
   (1:18) and the triggering furre (moved from/is standing at) object type #153,
*and use %duel as a condition to determine if the duel is ready to start. Take note you must check the true condition first.
   (1:200) and variable #%duel is equal to #1,
      (3:5) where the triggering furre (moved from/is standing at),
*place the lock
            (5:5) change object type #153 to type #40.
*change the duel variable to indicate a duel is in progress.
            (5:300) set variable #%duel to the value #2.
*set a time limit for the duel incase someone leaves the dream and thier is no winner.
            (5:50) set countdown timer #1 to go off in #120 seconds.
            (5:204) emitloud message {[FURRE] has Entered the Duel Arena!} to everyone on the map.
            (5:204) emitloud message {A Duel has Begun!} to everyone on the map.
            (5:312) set variable #%theme to the total of rolling #1 dice with #2 sides plus #100.
            (5:31) play midi #%theme to everyone on the map.
*randomize the weapon to be used in the duel to make it fair.
            (5:312) set variable #%weapon to the total of rolling #1 dice with #5 sides plus #2400.
*and within the area of the arena (or use a floor filter)
      (3:3) within the diamond (#20,#42) - (#20,#52),
*place the weapon in the dueling players paws
            (5:77) place object type #%weapon in the paws of any furre present.

*This code will trigger if there is no other Furre in the Arena, place a lock, and set the duel variable to "waiting for a challenger".
(0:2) When somebody moves into floor type #9,
   (1:18) and the triggering furre (moved from/is standing at) object type #153,
   (1:200) and variable #%duel is equal to #0,
      (3:5) where the triggering furre (moved from/is standing at),
            (5:5) change object type #153 to type #40.
            (5:300) set variable #%duel to the value #1.
            (5:50) set countdown timer #1 to go off in #120 seconds.
            (5:204) emitloud message {[FURRE] has Entered the Duel Arena!} to everyone on the map.

*Since the other side of the Arena is open when only 1 Furre is inside it, this clears the waiting conditiom and resets the arena variables.
(0:1) Whenever somebody moves,
   (1:18) and the triggering furre (moved from/is standing at) object type #153,
   (1:102) and they didn't move into floor type #9,
      (3:3) within the diamond (#20,#40) - (#20,#54),
            (5:50) set countdown timer #1 to go off in #1 seconds.
            (5:204) emitloud message {[FURRE] has left the Arena!} to everyone on the map.

*The Winning a Duel Code is basically the same as the PvP Scoring code with the additional condition of being within the Arena.
*It also has a special Duel Emit and starts the timer that resets the Arena.
(0:3) When somebody moves into object type #%scoreitem,
   (1:81) and the triggering furre is within the diamond (#20,#42) - (#20,#52),
            (5:204) emitloud message {[FURRE] has won the Duel!} to everyone on the map.
            (5:50) set countdown timer #1 to go off in #1 seconds.
            (5:12) play sound #64 to everyone on the map.

*This is the actual countdown timer that resets the Duel Arena after a win, when a furre leaves the arena, or a timeout.
(0:50) When countdown timer #1 goes off,
      (3:3) within the diamond (#20,#40) - (#20,#54),
            (5:5) change object type #40 to type #153.
      (3:3) within the diamond (#20,#42) - (#20,#52),
            (5:4) place object type #0.
            (5:17) move any furre present to (#20,#20), or to someplace nearby if it's occupied.
            (5:300) set variable #%duel to the value #0.
            (5:204) emitloud message {The Duel Arena is Open!} to everyone on the map.

*This Ends the Duel Arena Code.



  The Final Code:

*========================= Final Trigger ==============

*And finally, one of the most important codes to make it all work, so each players stats are monitored and checked every second.
*1 second retrigger

(0:71) When a furre stays in the same square for #1 seconds,
      (3:7) whereever the triggering furre was at when the trigger activated,
            (5:19) move any furre present #0 step(s) forward (in the direction they're facing) if there's nobody already there.


*Endtriggers* 8888 *Endtriggers*


Return to Main