summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-25 15:38:52 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-25 15:38:52 -0300
commit728e63eede2fbad2bcc0ad650f7ccdd6e2dae11e (patch)
tree5b52ea0fc288ed5b5ff814d57176aa87966e35c0 /npc
parent1b97a236aa16e61cfa52a019d036ed13ae9f9dde (diff)
downloadserverdata-728e63eede2fbad2bcc0ad650f7ccdd6e2dae11e.tar.gz
serverdata-728e63eede2fbad2bcc0ad650f7ccdd6e2dae11e.tar.bz2
serverdata-728e63eede2fbad2bcc0ad650f7ccdd6e2dae11e.tar.xz
serverdata-728e63eede2fbad2bcc0ad650f7ccdd6e2dae11e.zip
HUB - clean-up 001-8/hub and add functions/hub along blue sage Pyry's basic
loop.
Diffstat (limited to 'npc')
-rw-r--r--npc/001-8/hub.txt89
-rw-r--r--npc/003-3/malindou.txt3
-rw-r--r--npc/020-7-1/core.txt26
-rw-r--r--npc/020-7-1/janitors.txt2
-rw-r--r--npc/functions/hub.txt116
-rw-r--r--npc/scripts.conf1
6 files changed, 148 insertions, 89 deletions
diff --git a/npc/001-8/hub.txt b/npc/001-8/hub.txt
index c48e50204..d3d3044a5 100644
--- a/npc/001-8/hub.txt
+++ b/npc/001-8/hub.txt
@@ -379,94 +379,7 @@ OnPCLogoutEvent:
}
// TODO: Checks which doesn't belong here shouldn't be here!
- // Vanished on Cindy Cave
- if (.@mapa$ == "021-4" && strcharinfo(0) == $@CINDY_HERO$) {
- recovery(getcharid(3));
- warp any("010-1", "010-2"), 0, 0;
- percentheal -100, -100;
- sc_start2 SC_POISON, 1, 90, 10000;
- } else if (.@mapa$ == "021-4") {
- .@pl = getmapusers("021-4")-1;
- if (.@pl < 1)
- donpcevent("Cindy#Outside::OnCleanUp");
- recovery(getcharid(3));
- warp "Save", 0, 0;
- }
- // Logout while donating blood
- if (getq(HurnscaldQuest_BloodDonor) == 2) {
- slide 35, 28;
- setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_MOVE, false);
- setq HurnscaldQuest_BloodDonor, 0, gettimetick(2)+3600; // one hour penalty
- }
- // Logout/Death on Nard's ship hold
- if (.@mapa$ ~= "002-2" || .@mapa$ ~= "nard*") {
- setq2 ShipQuests_Peter, 0;
- setq3 ShipQuests_Peter, -1;
- }
- // Logout on botcheck area
- if (.@mapa$ ~= "botcheck" && !@qhub_died) {
- if (!is_staff())
- atcommand "@jail "+strcharinfo(0);
- }
- // Died on Terranite Cave where exp penalty is lower
- if (.@mapa$ == "015-6" && @qhub_died) {
- @deathpenalty_override=2;
- @deathpenalty_realvalue=readparam(BaseExp);
- @deathpenalty_realvaljob=readparam(JobExp);
- }
- // First death produces a warning message
- if (PC_DIE_COUNTER <= 1 && @qhub_died) {
- dispbottom l("Dying outside a town square will cause EXP loss.");
- }
- // If you were travelling and died/logged out, cleaning is needed
- if (@timer_navio_running) {
- @timer_navio_running=0;
- // Logged out? Correct your position to inside the ship
- // Of course, this is messy... But still better than Save Point
- if (!@qhub_died) {
- if (.@mapa$ ~= "016-*")
- warp "016-1", 28, 27;
- else if (.@mapa$ ~= "002-*")
- warp "002-1", 55, 40;
- else
- warp "Save", 0, 0;
- }
- }
- // Crazyfefe hot fix
- if (@qhub_died) {
- // It was PK
- if (killerrid > 2000000 && killerrid < 2100000) {
- // PVP flag was off
- if (!getmapflag(.@mapa$, mf_pvp) && !getmapflag(.@mapa$, mf_pvp_noparty) && !getmapflag(.@mapa$, mf_pvpnoguild)) {
- recovery(getcharid(3));
- warp .@mapa$, .@a, .@b;
- dispbottom l("REVENGE TIME!");
- .@trueid=getcharid(3);
- //detachrid();
- attachrid(killerrid);
- setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_COMMANDS, true);
- sc_start SC_WALKSPEED,120000,50;
- sc_end SC_CASH_PLUSEXP;
- sc_end SC_OVERLAPEXPUP;
- sc_start SC_OVERLAPEXPUP, 300000, -20;
- dispbottom l("For cowardingly killing in a \"secure\" area, you will be severely punished.");
- addtimer(15000, "#mobptsys::OnUnlock");
- percentheal -88, -100;
- detachrid();
- attachrid(.@trueid);
- }
- }
- }
-
- // This allows code to override death penalty, just once:
- // @deathpenalty_override
- // Valid values: 1- No penalty. 2- Halved penalty.
- // You must also set: @deathpenalty_realvalue and @deathpenalty_realvaljob
- if (@deathpenalty_override && @qhub_died) {
- if (is_staff())
- debugmes("Old values: %d %d Current Values: %d %d", @deathpenalty_realvalue, @deathpenalty_realvaljob, readparam(BaseExp), readparam(JobExp));
- addtimer(300, "#QuirinoHUB::OnNoPenaltyCommand");
- }
+ HUB_Logout(@qhub_died);
@qhub_victor=0;
@qhub_died=0;
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index fa542ef3f..00e427e8d 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -400,6 +400,9 @@ OnPCLoginEvent:
// Main update handler
checkclientversion();
+ // Position and gameplay fixes
+ HUB_Login();
+
// Daily rewards (always the last)
daily_login_bonus_handler();
end;
diff --git a/npc/020-7-1/core.txt b/npc/020-7-1/core.txt
index d7d5c755b..fb1b282ec 100644
--- a/npc/020-7-1/core.txt
+++ b/npc/020-7-1/core.txt
@@ -7,6 +7,7 @@
// Some setup is required
+// Check if you have something to ask to Blue Sage staff
// BSQuestion( )
function script BSQuestion {
.@b1=getq(NivalisQuest_BlueSage);
@@ -28,3 +29,28 @@ function script BSQuestion {
}
+// Proccess the slime type and amount
+// BSProccess( SlimeNestID )
+function script BSProccess {
+ .@b1=getq(NivalisQuest_BlueSageSlimes);
+ .@b2=getq2(NivalisQuest_BlueSageSlimes);
+ .@b3=getq3(NivalisQuest_BlueSageSlimes);
+
+ // Quest state not assigned
+ if (!.@b1)
+ return;
+
+ // TODO
+
+ return;
+}
+
+020-7-1,0,0,0 script #BlueSageHUB NPC_HIDDEN,{
+ end;
+
+OnCycle:
+ addtimer(1000, "#BlueSageHUB::OnCycle");
+ end;
+
+}
+
diff --git a/npc/020-7-1/janitors.txt b/npc/020-7-1/janitors.txt
index 02dc3b5c6..72a4b5a0b 100644
--- a/npc/020-7-1/janitors.txt
+++ b/npc/020-7-1/janitors.txt
@@ -7,7 +7,7 @@
// helperCleaning* + helperJanitor
// Quest: NivalisQuest_BlueSageSlimes
-// 1: Acception state
+// 1: Acception state (0 - Not accepted, 1 - Accepted, 2 - Complete)
// 2: Killed Slimes Control
// 3: Killed Nests Control
diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt
new file mode 100644
index 000000000..e3ee6d26c
--- /dev/null
+++ b/npc/functions/hub.txt
@@ -0,0 +1,116 @@
+// TMW2 scripts.
+// Authors:
+// Jesusalva
+// TMW Org.
+// Description:
+// HUB functions (Login, Logout, Death)
+
+// HUB_Login ()
+function script HUB_Login {
+ getmapxy(.@mapa$, .@a,.@b, 0);
+
+ // Login on Blue Sage Workshop/Library
+ if (.@mapa$ == "020-7-1") {
+ addtimer(1000, "#BlueSageHUB::OnCycle");
+ }
+
+ return;
+}
+
+// HUB_Logout ( {dead} )
+function script HUB_Logout {
+ .@dead=getarg(0, false);
+ getmapxy(.@mapa$, .@a,.@b, 0);
+
+ // Vanished on Cindy Cave
+ if (.@mapa$ == "021-4" && strcharinfo(0) == $@CINDY_HERO$) {
+ recovery(getcharid(3));
+ warp any("010-1", "010-2"), 0, 0;
+ percentheal -100, -100;
+ sc_start2 SC_POISON, 1, 90, 10000;
+ } else if (.@mapa$ == "021-4") {
+ .@pl = getmapusers("021-4")-1;
+ if (.@pl < 1)
+ donpcevent("Cindy#Outside::OnCleanUp");
+ recovery(getcharid(3));
+ warp "Save", 0, 0;
+ }
+ // Logout while donating blood
+ if (getq(HurnscaldQuest_BloodDonor) == 2) {
+ slide 35, 28;
+ setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_MOVE, false);
+ setq HurnscaldQuest_BloodDonor, 0, gettimetick(2)+3600; // one hour penalty
+ }
+ // Logout/Death on Nard's ship hold
+ if (.@mapa$ ~= "002-2" || .@mapa$ ~= "nard*") {
+ setq2 ShipQuests_Peter, 0;
+ setq3 ShipQuests_Peter, -1;
+ }
+ // Logout on botcheck area
+ if (.@mapa$ ~= "botcheck" && !.@dead) {
+ if (!is_staff())
+ atcommand "@jail "+strcharinfo(0);
+ }
+ // Died on Terranite Cave where exp penalty is lower
+ if (.@mapa$ == "015-6" && .@dead) {
+ @deathpenalty_override=2;
+ @deathpenalty_realvalue=readparam(BaseExp);
+ @deathpenalty_realvaljob=readparam(JobExp);
+ }
+ // First death produces a warning message
+ if (PC_DIE_COUNTER <= 1 && .@dead) {
+ dispbottom l("Dying outside a town square will cause EXP loss.");
+ }
+ // If you were travelling and died/logged out, cleaning is needed
+ if (@timer_navio_running) {
+ @timer_navio_running=0;
+ // Logged out? Correct your position to inside the ship
+ // Of course, this is messy... But still better than Save Point
+ if (!.@dead) {
+ if (.@mapa$ ~= "016-*")
+ warp "016-1", 28, 27;
+ else if (.@mapa$ ~= "002-*")
+ warp "002-1", 55, 40;
+ else
+ warp "Save", 0, 0;
+ }
+ }
+ // Crazyfefe hot fix
+ if (.@dead) {
+ // It was PK
+ if (killerrid > 2000000 && killerrid < 2100000) {
+ // PVP flag was off
+ if (!getmapflag(.@mapa$, mf_pvp) && !getmapflag(.@mapa$, mf_pvp_noparty) && !getmapflag(.@mapa$, mf_pvpnoguild)) {
+ recovery(getcharid(3));
+ warp .@mapa$, .@a, .@b;
+ dispbottom l("REVENGE TIME!");
+ .@trueid=getcharid(3);
+ //detachrid();
+ attachrid(killerrid);
+ setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_COMMANDS, true);
+ sc_start SC_WALKSPEED,120000,50;
+ sc_end SC_CASH_PLUSEXP;
+ sc_end SC_OVERLAPEXPUP;
+ sc_start SC_OVERLAPEXPUP, 300000, -20;
+ dispbottom l("For cowardingly killing in a \"secure\" area, you will be severely punished.");
+ addtimer(15000, "#mobptsys::OnUnlock");
+ percentheal -88, -100;
+ detachrid();
+ attachrid(.@trueid);
+ }
+ }
+ }
+
+ // This allows code to override death penalty, just once:
+ // @deathpenalty_override
+ // Valid values: 1- No penalty. 2- Halved penalty.
+ // You must also set: @deathpenalty_realvalue and @deathpenalty_realvaljob
+ if (@deathpenalty_override && .@dead) {
+ if (is_staff())
+ debugmes("Old values: %d %d Current Values: %d %d", @deathpenalty_realvalue, @deathpenalty_realvaljob, readparam(BaseExp), readparam(JobExp));
+ addtimer(300, "#QuirinoHUB::OnNoPenaltyCommand");
+ }
+
+ return;
+}
+
diff --git a/npc/scripts.conf b/npc/scripts.conf
index a5c220692..cb0a4176f 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -116,6 +116,7 @@
"npc/magic/zarkor.txt",
// These are to be proccessed later
+"npc/functions/hub.txt",
"npc/functions/gmbot.txt",
"npc/functions/instances.txt",