From efdd8d16ea3989efd07fc635a3ddef99722d60d7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 3 Apr 2018 10:24:42 -0300 Subject: This should be PVP Duel Arena (well, not as we wanted it, but that can work) --- npc/003-10/arnea.txt | 132 +++++++++++++++++++++++++++--------------------- npc/003-13/_import.txt | 1 + npc/003-13/arnea.txt | 82 +++++++----------------------- npc/003-13/mapflags.txt | 1 + 4 files changed, 95 insertions(+), 121 deletions(-) create mode 100644 npc/003-13/mapflags.txt (limited to 'npc') diff --git a/npc/003-10/arnea.txt b/npc/003-10/arnea.txt index a55db1fd0..d25996d5d 100644 --- a/npc/003-10/arnea.txt +++ b/npc/003-10/arnea.txt @@ -5,12 +5,7 @@ // Description: // Arena for Duels and PVP (003-13,31,31) -003-5,33,37,0 script Arnea NPC_ELF_F,{ - if (DESTROY_ME) { - DESTROY_ME=0; - instance_destroy(DESTROY_MY_ID); - } - +003-10,26,60,0 script Arnea NPC_ELF_F,{ // FIXIT code if (!is_staff()) goto L_Incomplete; @@ -30,33 +25,26 @@ L_NewArena: } else { mesq l("Okay, which arena will you rent? Cost is @@ GP.", .price); menu - rif($@ARENA_INSTANCES[0] < 0, l("Arena 1")), -, - rif($@ARENA_INSTANCES[1] < 0, l("Arena 2")), -, - rif($@ARENA_INSTANCES[2] < 0, l("Arena 3")), -, - rif($@ARENA_INSTANCES[3] < 0, l("Arena 4")), -, - rif($@ARENA_INSTANCES[4] < 0, l("Arena 5")), -, + rif(Zeny > 1000, l("Rent arena")), -, l("Give Up"), L_Quit; - mes (@menu-1); - .@ARENA_INSTID = instance_create("003-13@arenax"+(@menu), 0, IOT_NONE); - if (.@ARENA_INSTID >= 0) - { - mes "new instance id: " + str(.@ARENA_INSTID); - .@instanceMapName$ = instance_attachmap("003-13", .@ARENA_INSTID, 0, "003-13@a" + (@menu-1)); - if (.@instanceMapName$ == "") - { - mes "Error: instance attach map error"; - } else { - mes "Attached instance map name: " + .@instanceMapName$; - instance_set_timeout(1000000, 1000000, .@ARENA_INSTID); - instance_init(.@ARENA_INSTID); - set Zeny, Zeny-1000; - $@ARENA_INSTANCES[@menu-1]=getcharid(3); - } - } else { - mes l("An error happened."); - } - } + // Register to HTTable $@ARENAS (or override existing entry) your ID and a password + .@PASSWORD=getcharid(0)**1.137; + htput($@ARENAS, .@PASSWORD, getcharid(0)); + + // XXX - Important Note - XXX + // map name MUST be only 4 chars long (eg. "abcd") on char instances + .@ID=getcharid(0); + .@MAP$="AREN@"+str(.@ID); + + // Create the arena + .@INSTID = instance_create("003-10@"+(.@ID), getcharid(3), IOT_CHAR); + .@instanceMapName$ = instance_attachmap("003-13", .@INSTID, 0, .@MAP$); + instance_set_timeout(1800, 1800, .@INSTID); + instance_init(.@INSTID); + dispbottom l("Arena created, it can be used for 10 minutes."); + dispbottom l("Room password: @@", .@PASSWORD); + goto L_Quit; @@ -74,28 +62,23 @@ L_Info: L_JoinArena: mes ""; mesn; - if (Zeny < .price) { - mesq l("You need @@ GP to use this arena.", .price); - } else { - mesq l("Okay, which arena will you join? Cost is @@ GP.", .price); - //menu - // rif(has_instance2("003-5@0") >= 0, l("Arena 1")), -, - // rif(has_instance2("003-5@1") >= 0, l("Arena 2")), -, - // rif(has_instance2("003-5@2") >= 0, l("Arena 3")), -, - // rif(has_instance2("003-5@3") >= 0, l("Arena 4")), -, - // rif(has_instance2("003-5@4") >= 0, l("Arena 5")), -, - // l("Give Up"), L_Quit; - menu - rif($@ARENA_INSTANCES[0] > 0, l("Arena 1")), -, - rif($@ARENA_INSTANCES[1] > 0, l("Arena 2")), -, - rif($@ARENA_INSTANCES[2] > 0, l("Arena 3")), -, - rif($@ARENA_INSTANCES[3] > 0, l("Arena 4")), -, - rif($@ARENA_INSTANCES[4] > 0, l("Arena 5")), -, - l("Give Up"), L_Quit; - warp "003-13@a"+(@menu-1), 31,31; - set Zeny, Zeny-.price; - //instance_warpall("003-13@a"+@menu, 30, 31); // Only use while in instance + mesq l("Okay, to join an arena, you need the unique password. Leave blank if you don't know."); + + input .@user_password; + .@m = htget($@ARENAS, .@user_password, -1); + if (.@m > 0) { + if(has_instance2("003-10@"+.@m)) { + warp "AREN@"+str(.@m), 31,31; + } else { + mes ""; + mesn; + mesq l("Sorry, that arena is already closed."); + next; + mesn; + mesq l("All arenas stay open for only 30 minutes after being purchased."); + } } + close; @@ -122,14 +105,11 @@ OnInit: .sex = G_FEMALE; .distance = 5; - .alwaysVisible = true; + //.alwaysVisible = true; // This is dumb, why Jesusalva put it here? .price=1000; - // test instance id - setarray $@ARENA_INSTANCES, -1,-1,-1,-1,-1; // Controls Owners - setarray $@ARENA_INFOS$, "","","","",""; // Controls Owners - // Temporary fix - disablenpc "Arnea"; + // create hashtable + $@ARENAS = htnew(); end; OnInstanceInit: @@ -143,3 +123,39 @@ OnInstanceInit: end; } + + + /* + mes (@menu-1); + .@ARENA_INSTID = instance_create("003-13@arenax"+(@menu), 0, IOT_NONE); + if (.@ARENA_INSTID >= 0) + { + mes "new instance id: " + str(.@ARENA_INSTID); + .@instanceMapName$ = instance_attachmap("003-13", .@ARENA_INSTID, 0, "003-13@a" + (@menu-1)); + if (.@instanceMapName$ == "") + { + mes "Error: instance attach map error"; + } else { + mes "Attached instance map name: " + .@instanceMapName$; + instance_set_timeout(1000000, 1000000, .@ARENA_INSTID); + instance_init(.@ARENA_INSTID); + set Zeny, Zeny-1000; + $@ARENA_INSTANCES[@menu-1]=getcharid(3); + } + } else { + mes l("An error happened."); + } + } + + menu + rif($@ARENA_INSTANCES[0] > 0, l("Arena 1")), -, + rif($@ARENA_INSTANCES[1] > 0, l("Arena 2")), -, + rif($@ARENA_INSTANCES[2] > 0, l("Arena 3")), -, + rif($@ARENA_INSTANCES[3] > 0, l("Arena 4")), -, + rif($@ARENA_INSTANCES[4] > 0, l("Arena 5")), -, + l("Give Up"), L_Quit; + warp "003-13@a"+(@menu-1), 31,31; + set Zeny, Zeny-.price; + //instance_warpall("003-13@a"+@menu, 30, 31); // Only use while in instance + */ + diff --git a/npc/003-13/_import.txt b/npc/003-13/_import.txt index 484bc8b54..97f13c4dd 100644 --- a/npc/003-13/_import.txt +++ b/npc/003-13/_import.txt @@ -2,3 +2,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/003-13/_warps.txt", "npc/003-13/arnea.txt", +"npc/003-13/mapflags.txt", diff --git a/npc/003-13/arnea.txt b/npc/003-13/arnea.txt index 9b2329a4e..f04972aa5 100644 --- a/npc/003-13/arnea.txt +++ b/npc/003-13/arnea.txt @@ -6,59 +6,40 @@ // Arena for Duels and PVP (temporary map) 003-13,29,29,0 script Arnea#003-13 NPC_ELF_F,{ - // FIXIT - if (!is_staff()) { - hello; - end; + if (is_staff()) { + mes "npc name: " + .name$; + mes "npc ext name: " + .extname$; + mes "npc id: " + .id; + mes "npc parent id: " + .parent; + mes "npc src id: " + .srcId; + mes "char id 3: " + getcharid(3); + mes "instance id: " + instance_id(); + mes "Map ID: " + instance_mapname("003-13"); } - - mes "npc name: " + .name$; - mes "npc ext name: " + .extname$; - mes "npc id: " + .id; - mes "npc parent id: " + .parent; - mes "npc src id: " + .srcId; - mes "char id 3: " + getcharid(3); - mes "instance id: " + instance_id(); - mes "Map ID: " + instance_mapname("003-13"); - if (instance_id() >= 0) - { - mes "npc in instance named: " + instance_npcname(.name$); - next; + if (instance_id() >= 0) { goto L_Manage; - } - else - { + } else { + // Non staff and on 003-13? That's a bug! + if (!is_staff()) { + atcommand "@request Hey hey hey, player found in 003-13 - regular map! Report this to Jesusalva at once!"; + warp "Save", 0, 0; + close; + } mes "npc not in instance"; } + close; L_Manage: mesn; switch (select( "warp back", - rif(getcharid(3) == $@ARENA_INSTANCES[replacestr(instance_mapname("003-13"), "003-13@a", "")] || is_gm(),"delete"), "cancel")) { case 1: - warp "003-5", 33, 40; + warp "003-10", 33, 40; break; case 2: - if (instance_id() < 0) - { - mes "Error: not in an instance"; - break; - } - .@ArenaToFree=replacestr(instance_mapname("003-13"), "003-13@a", ""); - //mes .@ArenaToFree; - //next; - $@ARENA_INSTANCES[.@ArenaToFree]=-1; - warp "003-5", 33, 40; - DESTROY_ME=1; - DESTROY_MY_ID=instance_id(); - //instance_detachmap("003-13"); - //instance_destroy(instance_id()); // TODO FIXME - break; - case 3: break; } close; @@ -73,10 +54,6 @@ OnInit: .sex = G_FEMALE; .distance = 9; - // test instance id - - // Temporary fix - disablenpc "Arnea#003-13"; end; OnInstanceInit: @@ -91,24 +68,3 @@ OnInstanceInit: } - -/* - .@ID=getcharid(0); - .@MUNDANE_INSTID = instance_create("001-3-0@a"+(.@ID), 0, IOT_NONE); - //debugmes "You are "+str(.@ID); - - //if (.@MUNDANE_INSTID < 0) debugmes "Error: No instance ID"; - //debugmes "new instance id: " + str(.@MUNDANE_INSTID); - - .@instanceMapName$ = instance_attachmap("001-3-0", .@MUNDANE_INSTID, 0, str(.@ID)); - - //if (.@instanceMapName$ == "") debugmes "Error: Map 001-3-0 X failed"; - //debugmes "Created map: "+ str(.@instanceMapName$); - - instance_set_timeout(300000, 300000, .@MUNDANE_INSTID); - instance_init(.@MUNDANE_INSTID); - - warp str(.@ID), 161,59; - close; - -*/ diff --git a/npc/003-13/mapflags.txt b/npc/003-13/mapflags.txt new file mode 100644 index 000000000..28143b5a8 --- /dev/null +++ b/npc/003-13/mapflags.txt @@ -0,0 +1 @@ +003-13 mapflag pvp -- cgit v1.2.3-70-g09d2