From 1462af22e353a075ad283c899c6e4aa9004b9bc4 Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Sun, 24 Mar 2013 11:00:37 +0100 Subject: WIP: Punish players who don't move from their position during Candor. When a new round starts, the position of the player is compared with the position from the last round. If it's the same, the player is poisoned and damage is dealt based on how often the player didn't change their position. --- world/map/npc/029-3/parua.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/world/map/npc/029-3/parua.txt b/world/map/npc/029-3/parua.txt index 78014e98..c4b258f2 100644 --- a/world/map/npc/029-3/parua.txt +++ b/world/map/npc/029-3/parua.txt @@ -166,6 +166,8 @@ L_NextRound: goto L_CleanUp; set $@FIGHT_CAVE_POINTS, $@FIGHT_CAVE_LEVEL; + areatimer "029-3.gat", 20, 20, 70, 60, 10, "Parua::onNewRound"; + mapannounce "029-1.gat", "Parua: The next round (level " + $@FIGHT_CAVE_LEVEL + ") is starting with " + $@FIGHT_CAVE_PLAYER_COUNT + " player(s) left alive." , 0; mapannounce "029-3.gat", "Parua: The next round (level " + $@FIGHT_CAVE_LEVEL + ") is starting with " + $@FIGHT_CAVE_PLAYER_COUNT + " player(s) left alive." , 0; @@ -269,6 +271,23 @@ onTick: set $@FIGHT_CAVE_PLAYER_COUNT, $@FIGHT_CAVE_PLAYER_COUNT + 1; end; +// called on each player when a new round begins +onNewRound: + // TODO initialization and clean-up of the variables + if (isdead()) + end; + set @candor_oldx, @candor_x; + set @candor_oldy, @candor_y; + set @candor_x, getx(); + set @candor_y, gety(); + if (!(@candor_oldx == @candor_x && @candor_oldy == @candor_y)) + end; + @candor_poscounter, @candor_poscounter + 1; + sc_start sc_poison, 1, 20; + heal -20 * @candor_poscounter, 0; + message strcharinfo(0), "The evil energy of this place hurts you. You should keep moving!"; + end; + onPetDeath: end; -- cgit v1.2.3-60-g2f50 From 0465893d31020aa8b78eed3105b3b37761d3038c Mon Sep 17 00:00:00 2001 From: Vincent Petithory Date: Sun, 24 Mar 2013 12:26:20 +0100 Subject: Candor Fix: * Clean player variables when the player dies / at end of round * Do no punish players before round 600 * Hurt players based on a % of their Max HP, not a fixed value * Make the poison duration depend on the severity of the punishment (8s per increment) --- world/map/npc/029-3/parua.txt | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/world/map/npc/029-3/parua.txt b/world/map/npc/029-3/parua.txt index c4b258f2..4fab5b6b 100644 --- a/world/map/npc/029-3/parua.txt +++ b/world/map/npc/029-3/parua.txt @@ -273,18 +273,19 @@ onTick: // called on each player when a new round begins onNewRound: - // TODO initialization and clean-up of the variables if (isdead()) + goto L_CleanUp_Player; + if ($@FIGHT_CAVE_LEVEL < 600) end; set @candor_oldx, @candor_x; set @candor_oldy, @candor_y; set @candor_x, getx(); set @candor_y, gety(); if (!(@candor_oldx == @candor_x && @candor_oldy == @candor_y)) - end; - @candor_poscounter, @candor_poscounter + 1; - sc_start sc_poison, 1, 20; - heal -20 * @candor_poscounter, 0; + goto L_IdleCheckPassed; + set @candor_idle_counter, @candor_idle_counter + 1; + sc_start sc_poison, 1, @candor_idle_counter*8; + percentheal -20 * @candor_idle_counter, 0; message strcharinfo(0), "The evil energy of this place hurts you. You should keep moving!"; end; @@ -317,10 +318,24 @@ L_CleanUp_Announcement: setnpctimer 0; end; +L_CleanUp_Player: + set @candor_oldx, 0; + set @candor_oldy, 0; + set @candor_x, 0; + set @candor_y, 0; + set @candor_idle_counter, 0; + end; + +L_IdleCheckPassed: + //FIXME we could do that, but I'd say, let's be severe. + //set @candor_idle_counter, 0; + end; + onReward: - if (isdead()) end; + if (isdead()) + goto L_CleanUp_Player; set BOSS_POINTS, BOSS_POINTS + 100; message strcharinfo(0), "You gain 100 Boss Points giving you a total of " + BOSS_POINTS; - end; + goto L_CleanUp_Player; } -- cgit v1.2.3-60-g2f50 From e7aac80a59d9902e173409da062f49bc6f0372f3 Mon Sep 17 00:00:00 2001 From: Vincent Petithory Date: Sun, 24 Mar 2013 12:41:09 +0100 Subject: Candor fix: Clean dead players' variables with OnPCDieEvent --- world/map/npc/029-3/parua.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/world/map/npc/029-3/parua.txt b/world/map/npc/029-3/parua.txt index 4fab5b6b..148e1d4d 100644 --- a/world/map/npc/029-3/parua.txt +++ b/world/map/npc/029-3/parua.txt @@ -274,7 +274,7 @@ onTick: // called on each player when a new round begins onNewRound: if (isdead()) - goto L_CleanUp_Player; + end; if ($@FIGHT_CAVE_LEVEL < 600) end; set @candor_oldx, @candor_x; @@ -318,6 +318,9 @@ L_CleanUp_Announcement: setnpctimer 0; end; +OnPCDieEvent: + // fall through L_CleanUp_Player + L_CleanUp_Player: set @candor_oldx, 0; set @candor_oldy, 0; @@ -333,7 +336,7 @@ L_IdleCheckPassed: onReward: if (isdead()) - goto L_CleanUp_Player; + end; set BOSS_POINTS, BOSS_POINTS + 100; message strcharinfo(0), "You gain 100 Boss Points giving you a total of " + BOSS_POINTS; goto L_CleanUp_Player; -- cgit v1.2.3-60-g2f50 From 29efdf9573ea2dc072ecf8522538adbbb8a29880 Mon Sep 17 00:00:00 2001 From: Vincent Petithory Date: Sun, 24 Mar 2013 12:43:42 +0100 Subject: Candor Fix: More severe with poison duration --- world/map/npc/029-3/parua.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/map/npc/029-3/parua.txt b/world/map/npc/029-3/parua.txt index 148e1d4d..129a17eb 100644 --- a/world/map/npc/029-3/parua.txt +++ b/world/map/npc/029-3/parua.txt @@ -284,7 +284,7 @@ onNewRound: if (!(@candor_oldx == @candor_x && @candor_oldy == @candor_y)) goto L_IdleCheckPassed; set @candor_idle_counter, @candor_idle_counter + 1; - sc_start sc_poison, 1, @candor_idle_counter*8; + sc_start sc_poison, 1, @candor_idle_counter*25; percentheal -20 * @candor_idle_counter, 0; message strcharinfo(0), "The evil energy of this place hurts you. You should keep moving!"; end; -- cgit v1.2.3-60-g2f50