summaryrefslogtreecommitdiff
path: root/npc/boss
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 21:44:22 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 21:44:22 -0300
commita7c45a192268da2601cef47a4cdba987ae2327ca (patch)
treec5fb5b97db109fe7106496dd96498c475881046b /npc/boss
downloadserverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.gz
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.bz2
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.xz
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.zip
Initial commit (Moubootaur Legends fork)
Diffstat (limited to 'npc/boss')
-rw-r--r--npc/boss/_import.txt4
-rw-r--r--npc/boss/manamarket.txt107
-rw-r--r--npc/boss/throne.txt162
3 files changed, 273 insertions, 0 deletions
diff --git a/npc/boss/_import.txt b/npc/boss/_import.txt
new file mode 100644
index 0000000..60544f5
--- /dev/null
+++ b/npc/boss/_import.txt
@@ -0,0 +1,4 @@
+// Map boss: Boss Arena
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/boss/manamarket.txt",
+"npc/boss/throne.txt",
diff --git a/npc/boss/manamarket.txt b/npc/boss/manamarket.txt
new file mode 100644
index 0000000..c3c5bc2
--- /dev/null
+++ b/npc/boss/manamarket.txt
@@ -0,0 +1,107 @@
+// TMW2 Scripts.
+// Author:
+// Jesusalva
+// Description:
+// ManaMarket sketch
+
+boss,41,41,0 script ManaMarket NPC_TEDDYGIRL,{
+ function MMCooldown;
+ function MMBuy;
+ function MMBuyMenu;
+
+ if (!is_staff()) end;
+ mesn;
+ mesq l("Hello! How can I help you?");
+ if (MM_DELAY > gettimetick(2)) close;
+ next;
+ select
+ l("Buy"),
+ l("Sell"),
+ l("Nothing");
+ mes "";
+ if (@menu == 1)
+ MMBuy();
+ close;
+
+
+// Set the cooldown value to the same as interserver value
+function MMCooldown {
+ MM_DELAY=gettimetick(2)+300;
+ return;
+}
+
+// MMBuy(page=0)
+function MMBuy {
+ .@p=getarg(0,0);
+ .@v=MMBuyMenu(.@p);
+
+ // Special results
+ switch (.@v) {
+ case -1:
+ return;
+ case -2:
+ // FIXME
+ MMBuy(.@p+1);
+ break;
+ default:
+ break;
+ }
+
+ .@it=$@MM_nameid[.@v];
+ // Can't buy stuff you already have
+ if (countitem(.@it)) {
+ mesn;
+ mesq l("You already have this.");
+ return;
+ }
+
+
+ // Report
+ mesn;
+ mesq l("Purchase %02d %s for %d GP?",
+ $@MM_amount[.@v], getitemlink(.@it), $@MM_price[.@v]);
+ next;
+ if (askyesno() == ASK_YES) {
+ // TODO: Check if still in stock
+ mesn;
+ mesq l("Sorry. The arrays can't have zeros.");
+ // getitem2
+ }
+ return;
+}
+
+// MMBuyMenu ( page=0 )
+function MMBuyMenu {
+ deletearray @mm_menu$;
+ setarray @mm_menu$, l("Cancel"), "-1";
+ .@pg=getarg(0, 0);
+ .@limit=min(getarraysize($@MM_id), (.@pg+1)*20);
+
+ // Prepare the information array
+ for (.@i=.@pg*20; .@i < .@limit; .@i++) {
+ //@mm_menu$+=getitemname($@MM_nameid[.@i])+":";
+ array_push(@mm_menu$, getitemname($@MM_nameid[.@i]));
+ array_push(@mm_menu$, str(.@i));
+ }
+
+ // Still more pages
+ if (.@limit < getarraysize($@MM_id)) {
+ array_push(@mm_menu$, "Next Page >>");
+ array_push(@mm_menu$, "-2");
+ }
+
+ // Handle input
+ menuint2(@mm_menu$);
+ deletearray @mm_menu$;
+ return @menuret;
+}
+
+OnInit:
+ .distance=6;
+ .sex = G_FEMALE;
+
+ // Load ManaMarket (max 100 entries)
+ .@nb = query_sql("SELECT `id`, `account_id`, `price`, `expire_time`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, `opt_idx0`, `opt_val0`, `opt_idx1`, `opt_val1`, `opt_idx2`, `opt_val2`, `opt_idx3`, `opt_val3`, `opt_idx4`, `opt_val4` FROM `manamarket` ORDER BY `id` DESC LIMIT 100", $@MM_id, $@MM_account_id, $@MM_price, $@MM_expire_time, $@MM_nameid, $@MM_amount, $@MM_equip, $@MM_identify, $@MM_refine, $@MM_attribute, $@MM_card0, $@MM_card1, $@MM_card2, $@MM_card3, $@MM_opt_idx0, $@MM_opt_val0, $@MM_opt_idx1, $@MM_opt_val1, $@MM_opt_idx2, $@MM_opt_val2, $@MM_opt_idx3, $@MM_opt_val3, $@MM_opt_idx4, $@MM_opt_val4);
+ end;
+}
+
diff --git a/npc/boss/throne.txt b/npc/boss/throne.txt
new file mode 100644
index 0000000..8bf51d0
--- /dev/null
+++ b/npc/boss/throne.txt
@@ -0,0 +1,162 @@
+// TMW2 Scripts.
+// Author:
+// Jesusalva
+// Description:
+// Monster King Throne ($@MK_CHALLENGE)
+
+boss,45,45,0 script #monsterthrone NPC_HIDDEN,0,0,{
+ end;
+
+OnTouch:
+ if (strcharinfo(2) == "Monster King") end;
+ warp "boss", 45, 48;
+ percentheal -15,0;
+ dispbottom "The throne is cursed, only the Monster King may seat on it.";
+ end;
+
+// Controls the Event
+OnBegin:
+ .CYCLES=0;
+ $@MK_CHALLENGE=true;
+ .MK=monster("boss", 45, 45, "The Monster King", MonsterKing, 1, .name$+"::OnVictory");
+ .@bhp=getunitdata(.MK, UDT_MAXHP);
+ setunitdata(.MK, UDT_MAXHP, .@bhp+2000*.FAILS);
+ setunitdata(.MK, UDT_HP, .@bhp+2000*.FAILS);
+
+ // Spawn reinforcements
+ .@mobId=MonsterLieutenant;
+ .@ts$="Lieutenant";
+ monster("boss", 40, 40, strmobinfo(1, .@mobId), .@mobId, 1);
+ monster("boss", 50, 50, strmobinfo(1, .@mobId), .@mobId, 1);
+ monster("boss", 40, 50, strmobinfo(1, .@mobId), .@mobId, 1);
+ monster("boss", 50, 40, strmobinfo(1, .@mobId), .@mobId, 1);
+
+ mapannounce("boss", "Begin!", bc_map|bc_npc);
+ initnpctimer;
+ end;
+
+function CheckFinalAssault {
+ if (!siege_calcdiff("boss", 5)) {
+ kamibroadcast("You noobs, you all deserve to die!", "Monster King");
+ stopnpctimer;
+ $@MK_CHALLENGE=false;
+ // Clean Up
+ mapwarp("boss", "017-1", 120, 88);
+ killmonsterall("boss");
+ // Raise difficulty
+ .FAILS+=1;
+ // Halt execution
+ end;
+ }
+ return;
+}
+
+OnTimer120000:
+ .CYCLES+=1;
+ //areamonster("boss", 20, 20, 70, 70, "Monster King Slave", );
+ // Spawn several monsters on the Boss Room every 2 minutes
+ siege_cast("boss", .name$, .FAILS, TP_TULIM|TP_HURNS|TP_NIVAL);
+ // Spawn an extra mini-boss at minutes: 10 and 30
+ if (.CYCLES == 5) {
+ .@mobId=MonsterColonel;
+ .@ts$="Colonel";
+ monster("boss", 45, 44, strmobinfo(1, .@mobId), .@mobId, 1);
+ }
+ if (.CYCLES == 15) {
+ .@mobId=MonsterGeneral;
+ .@ts$="General";
+ monster("boss", 45, 44, strmobinfo(1, .@mobId), .@mobId, 1);
+ }
+ initnpctimer;
+OnTimer15000:
+ // Each fail raise curse duration in 0.1s - chance of curse is 15% each 15s
+ if (rand2(100) <= 15) {
+ areasc2("boss", 45, 45, 25, 3000+(.FAILS*100), SC_CURSE, BL_PC | BL_HOM | BL_MER);
+ //globalmes("MSG");
+ unittalk(.MK, "Be cursed, you fools! I am the mighty Monster King!!");
+ }
+OnTimer5000:
+OnTimer10000:
+OnTimer20000:
+OnTimer25000:
+OnTimer30000:
+OnTimer35000:
+OnTimer40000:
+OnTimer45000:
+OnTimer50000:
+OnTimer55000:
+OnTimer60000:
+OnTimer65000:
+OnTimer70000:
+OnTimer75000:
+OnTimer80000:
+OnTimer85000:
+OnTimer90000:
+OnTimer95000:
+OnTimer100000:
+OnTimer105000:
+OnTimer110000:
+OnTimer115000:
+ CheckFinalAssault();
+ end;
+
+// Monster King was defeated - game won
+OnVictory:
+ // Not killed by a player? It doesn't counts, then
+ if (!playerattached())
+ end;
+ $@MK_CHALLENGE=false;
+ kamibroadcast("has just defeated the Monster King.", strcharinfo(0));
+ stopnpctimer;
+ mapwarp("boss", "017-1", 120, 88);
+ $GAME_STORYLINE=5;
+ specialeffect(FX_FANFARE, AREA, getcharid(3));
+ // Without the Monster King to rule monsters... TODO Isbamuth
+ setbattleflag("monster_ai", 0x209);
+ setbattleflag("monster_active_enable", false);
+ setbattleflag("mob_count_rate", 25);
+ //charcommand("@reloadbattleconf"); // Careful!
+ donpcevent("@exprate::OnReload");
+ donpcevent("@droprate::OnReload");
+ // Player Reward
+ /*getitembound(AegisShield, 1, 1);
+ dispbottom l("For defeating the Monster King, you've got the Legendary @@.", getitemlink(AegisShield));
+ dispbottom l("This item cannot be traded normally and is a Legendary Item.");
+ dispbottom l("You can transfer it with \"@grantpower\" command. Please contact a GM for more info.");
+ dispbottom l("Protip: If you plan in selling it, it's adviseable to ask for GM mediation."); */
+ end;
+}
+
+// Room Traps, only against players
+boss,0,0,0 script #MKBossTrap01 NPC_TRAP,0,0,{
+ end;
+
+OnTouch:
+ SteelTrap(rand2(10, 20));
+ end;
+
+OnTimer10000:
+ stopnpctimer;
+ setnpctimer 0;
+ setnpcdisplay .name$, NPC_TRAP;
+ //end;
+ // Move the trap away after it disarms
+
+OnMinute14:
+OnMinute26:
+OnMinute40:
+OnMinute54:
+OnInit:
+ .@x=rand2(20,70);
+ .@y=rand2(20,70);
+ movenpc .name$, .@x, .@y;
+ end;
+}
+
+// Create more traps. (They can be on walls)
+boss,0,0,0 duplicate(#MKBossTrap01) #MKBossTrap02 NPC_TRAP,0,0
+boss,0,0,0 duplicate(#MKBossTrap01) #MKBossTrap03 NPC_TRAP,0,0
+boss,0,0,0 duplicate(#MKBossTrap01) #MKBossTrap04 NPC_TRAP,0,0
+boss,0,0,0 duplicate(#MKBossTrap01) #MKBossTrap05 NPC_TRAP,0,0
+
+