Post by Tazco on Oct 8, 2010 14:30:04 GMT -5
Since there is alot of people that want some form of pvp in there game. I decided to give these sets of scripts, plus the flag model. note if you have a flag model use it, I am a scripter not a modeler, you will see why.....
This is the cash flag that was in Strictly pvp.
So for the scripts.
First you will need to spawn the cash flag. You need to change the flag spawn loctaions.
Script name Flag_emitter.rsl
When flag is spawned from above script, it will attach this script to the flag (Model) as a right click script.
The player that executes this script, will also be tagged with kill to get cash flag. If player loses or drops the flag it will remove it and respawn it. Unless its given to the player that kills you. Npc killing the flag holder should make the flag respawn.
Script name PvpBattleground1Playercheck.rsl
When above script is executed by a player this script will run, until the player loses the cash flag. Either they die or drop it.
Flag holder will, collect 10 copper every 5.5 secs or so.
Script name Flag Held.rsl
Now you will need to add this, to your death script so flag will be taken.
The last thing you would need to do is, add this to your combat script. In the area that checks if target is dead you will need this. by adding this your target will lose the cash flag if they die by another player. Just add a is human check to this.
You can grab the flag model here.
www.megaupload.com/?d=55C6USW2
These scripts was made in a few hours, a while back for strictly pvp (GIAD progect). Not as much time was spent with them, as my other scripts. Hope you like it, there is almost an unlimited amount of ideas you can pull from this. I did the leg work, now what can you do with it?
This is the cash flag that was in Strictly pvp.
So for the scripts.
First you will need to spawn the cash flag. You need to change the flag spawn loctaions.
Script name Flag_emitter.rsl
Using "RC_Core.rcm"
; Strictly Pvp 1.30
; Date/Time: 11:34:01 PM on 9/1/2009
; By Tazco on NADDAZ
Function Main()
;----------------------------------------------
;Spawn cash flag
;----------------------------------------------
SetSuperglobal(2, 0)
ID% = ActorID("Flag", "Cash Flag")
FlagId% = SuperGlobal(2)
If (FlagId >= 5)
Return
Endif
RSP% = Rand(1, 12)
If (RSP% = 1)
Spawn(ID, "Alanon", 117.021, 20.0891, - 128.164, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 2)
Spawn(ID, "Alanon", 128.823, 20.6452, - 248.263, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 3)
Spawn(ID, "Alanon", 368.499, 8.88473, - 193.697, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 4)
Spawn(ID, "Alanon", 594.897, 146.401, - 221.472, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 5)
Spawn(ID, "Alanon", 434.989, 19.3827, 59.4121, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 6)
Spawn(ID, "Alanon", 644.611, 27.9001, 237.594, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 7)
Spawn(ID, "Alanon", 312.571, 15.5942, 460.691, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 8)
Spawn(ID, "Alanon", 154.848, 23.149, 455.334, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 9)
Spawn(ID, "Alanon", 58.7339, 15.6369, 283.744, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 10)
Spawn(ID, "Alanon", - 96.8189, 18.9734, 203.584, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 11)
Spawn(ID, "Alanon", - 108.293, 11.793, 17.9553, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 12)
Spawn(ID, "Alanon", 243.767, 25.3408, 340.311, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
Endif
;------------------------------------------
;end cash flag spawn
;------------------------------------------
End Function
When flag is spawned from above script, it will attach this script to the flag (Model) as a right click script.
The player that executes this script, will also be tagged with kill to get cash flag. If player loses or drops the flag it will remove it and respawn it. Unless its given to the player that kills you. Npc killing the flag holder should make the flag respawn.
Script name PvpBattleground1Playercheck.rsl
Using "RC_Core.rcm"
; strictly pvp
; Date/Time: 7:18:48 PM on 9/1/2009
; By Tazco on NADDAZ
Function Main()
Player = Actor()
Target = ContextActor()
PBar% = CreateProgressBar(Player, 55, 25, 155, 0.40, 0.82, 0.2, 0.04, 10, 10, "Collecting the Item") ; casting bar
Ticks% = 10 ;amount of for ticks also change the max and valve number in the PBar above.
Repeat
Hp% = Attribute(Player, "Health")
ThreadExecute("Flag Held", "Main", Player, 0)
DoEvents(500)
Ticks% = Ticks - 1
UpdateProgressBar(Player, PBar, Ticks) ;update progress bar
If (Hp <= 0 ) ; if players health goes bellow zero then stop the item from being picked up.
DeletePRogressBar(Player, Pbar)
Return
Endif
Until (Ticks = 0)
SetSuperGlobal(2, 0)
DeleteProgressBar(Player, PBar)
SetTag(Player, "Item Holder, Kill for extra cash!!!")
GiveItem(Player, "Cash Flag")
Killactor(Target, Player)
OutPut(Player, "You have collected the Cash Flag!!", 223, 43, 235)
SetSuperGlobal(0, 5)
End Function
When above script is executed by a player this script will run, until the player loses the cash flag. Either they die or drop it.
Flag holder will, collect 10 copper every 5.5 secs or so.
Script name Flag Held.rsl
Using "RC_Core.rcm"
; strictly pvp
; Date/Time: 7:48:28 PM on 9/1/2009
; By Tazco on NADDAZ
; called by pvpbattleground1playercheck
Function Main()
Player = Actor()
Holdtime% = 5
DoEvents(18500)
Repeat
HeldCashflag% = hasItem(Player, "Cash Flag")
Holdtime% = Holdtime - 1
DoEvents(5500)
If (HeldCashflag = 1)
ChangeMoney(Player, 10)
OutPut(Player, "You have gained 10 coins.")
Endif
If (Holdtime = 0)
GiveItem(Player, "Cash Flag", - 1)
HeldCashflag% = 0
Endif
Until (HeldCashflag = 0)
DoEvents(1000) ; Amount of time before the script will spawn the flag again.
FlagId% = SuperGlobal(2)
ID% = ActorID("Flag", "Cash Flag")
If (FlagId >= 5)
Return
Endif
RSP% = Rand(1, 12) ;random spwan point
If (RSP% = 1)
Spawn(ID, "Alanon", 117.021, 20.0891, - 128.164, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 2)
Spawn(ID, "Alanon", 128.823, 20.6452, - 248.263, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 3)
Spawn(ID, "Alanon", 368.499, 8.88473, - 193.697, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 4)
Spawn(ID, "Alanon", 594.897, 146.401, - 221.472, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 5)
Spawn(ID, "Alanon", 434.989, 19.3827, 59.4121, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 6)
Spawn(ID, "Alanon", 644.611, 27.9001, 237.594, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 7)
Spawn(ID, "Alanon", 312.571, 15.5942, 460.691, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 8)
Spawn(ID, "Alanon", 154.848, 23.149, 455.334, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 9)
Spawn(ID, "Alanon", 58.7339, 15.6369, 283.744, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 10)
Spawn(ID, "Alanon", - 96.8189, 18.9734, 203.584, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 11)
Spawn(ID, "Alanon", - 108.293, 11.793, 17.9553, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
ElseIf (RSP% = 12)
Spawn(ID, "Alanon", 243.767, 25.3408, 340.311, "PvpBattleground1playercheck")
SetSuperGlobal(2, 5)
Endif
End Function
Now you will need to add this, to your death script so flag will be taken.
If hasItem(Actor(), "Cash Flag" = 1)
GiveItem(Actor(), "Cash Flag", - 1)
Endif
The last thing you would need to do is, add this to your combat script. In the area that checks if target is dead you will need this. by adding this your target will lose the cash flag if they die by another player. Just add a is human check to this.
HeldCashflag% = hasItem(Target, "Cash Flag")
If (HeldCashflag = 1)
GiveItem(Target, "Cash Flag", - 1)
GiveItem(Player, "Cash Flag")
OutPut(Player, "Your target had the Cash Flag, now you have it.", 124, 233, 64)
Endif
You can grab the flag model here.
www.megaupload.com/?d=55C6USW2
These scripts was made in a few hours, a while back for strictly pvp (GIAD progect). Not as much time was spent with them, as my other scripts. Hope you like it, there is almost an unlimited amount of ideas you can pull from this. I did the leg work, now what can you do with it?