diff options
-rw-r--r-- | npc/042-11/boss.txt | 45 | ||||
-rw-r--r-- | npc/042-5/ctrl.txt | 55 |
2 files changed, 64 insertions, 36 deletions
diff --git a/npc/042-11/boss.txt b/npc/042-11/boss.txt index 18c6e8515..f2f9af363 100644 --- a/npc/042-11/boss.txt +++ b/npc/042-11/boss.txt @@ -29,8 +29,10 @@ OnTouch: mes l("Are you sure you want leave?"); mesc l("You wont be able to go back!"); next; - if (askyesno() == ASK_YES) + if (askyesno() == ASK_YES) { warp "042-0@"+.@g, 46, 25; + callfunc("KamelotTreasure", 1024, true); // Give a reward from the exclusive chest + } close; L_NoAccess: @@ -155,59 +157,73 @@ OnTimer5000: // Execute the skill switch (.@skill) { case 1: - .@msg$ = l("Witness my sublime rain of death. Regeneration!"); - .@hp=getunitdata(@mb, UDT_HP); - .@mp=getunitdata(@mb, UDT_MAXHP); - setunitdata(@mb, UDT_HP, min(.@mp, .@hp+(.@lv * 50))); + .@msg$ = sprintf("Witness my sublime rain of death. Regeneration!"); + .@hp=getunitdata(.@mob, UDT_HP); + .@mp=getunitdata(.@mob, UDT_MAXHP); + setunitdata(.@mob, UDT_HP, min(.@mp, .@hp+(.@lv * 50))); .@mobid=(rand2(.@lv) > 50 ? DeathCat : GreenSlime); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 2: - .@msg$ = l("Chaos shall be the founding stone of my town! Falling star!"); + .@msg$ = sprintf("Chaos shall be my founding stone! Falling star!"); + attachrid(.@rnd); percentheal -5, -10; + detachrid(); .@mobid=(rand2(.@lv) > 50 ? BlackScorpion : RedSlime); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 3: - .@msg$ = l("I, the rightful ruler, demand back this world! Tyranny!"); + .@msg$ = sprintf("I demand this world! Tyranny!"); + attachrid(.@rnd); percentheal -1, -1; SC_Bonus(.@t, any(SC_BLIND, SC_POISON), 1); + detachrid(); .@mobid=(rand2(.@lv) > 50 ? DarkLizard : Assassin); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 4: - .@msg$ = l("Stop on your tracks, unfair being! Freeze!"); + .@msg$ = sprintf("Stop on your tracks, unfair being! Freeze!"); + attachrid(.@rnd); SC_Bonus((.@t / 2), any(SC_FREEZE, SC_SLEEP, SC_SLEEP, SC_SLEEP), 1); + detachrid(); .@mobid=(rand2(.@lv) > 50 ? BlueSlime : WhiteSlime); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 5: - .@msg$ = l("There is no free speech. Censorship!"); + .@msg$ = sprintf("There is no free speech. Censorship!"); + attachrid(.@rnd); SC_Bonus(.@t, SC_SILENCE, 1); + detachrid(); .@mobid=(rand2(.@lv) > 50 ? Thug : RedMushroom); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 6: - .@msg$ = l("And then... There was a quake. And all life died. Bleed!"); + .@msg$ = sprintf("And then... There was a quake. And all life died. Bleed!"); + attachrid(.@rnd); SC_Bonus(.@t, SC_BLOODING, 1); + detachrid(); .@mobid=(rand2(.@lv) > 50 ? BlackSlime : OldSnake); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 7: - .@msg$ = l("Puny mortal, do your best to entertain me! Curse!"); + .@msg$ = sprintf("Puny mortal, do your best to entertain me! Curse!"); + attachrid(.@rnd); SC_Bonus(.@t, SC_CURSE, 1); + detachrid(); .@mobid=(rand2(.@lv) > 50 ? FireSkull : Skeleton); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 8: - .@msg$ = l("The problem with typos is - unpredictable side effects."); + .@msg$ = sprintf("The problem with typos is - unpredictable side effects."); + attachrid(.@rnd); SC_Bonus(.@t, any(SC_SILENCE, SC_CURSE, SC_FREEZE, SC_BLOODING, SC_BLIND, SC_POISON, SC_DPOISON, SC_POISON, SC_BURNING, SC_SLEEP), 1); + detachrid(); .@mobid=(rand2(.@lv) > 50 ? Swashbuckler : Bluepar); monster(.@m$, .@x, .@y, strmobinfo(1, .@mobid), .@mobid, 1); break; case 9: // Second Attack Pattern: Holy Light (vs Tank) - unittalk(.@mob, sprintf("%s, I'll show you no mercy! ##BThunder Bolt##b!", strcharinfo(0, "cursed player", .@mvp))); + .@msg$ = sprintf("%s, I'll show you no mercy! ##BThunder Bolt##b!", strcharinfo(0, "cursed player", .@mvp)); .@PW=125; .@SPW=25; .@RG=1; .@mtk = calcdmg(.@mob, .@mvp, HARM_MAGI); .@dmg = .@mtk * .@PW / 100; @@ -219,7 +235,7 @@ OnTimer5000: break; default: // First Attack Pattern: Napalm Beat (vs Random) - unittalk(.blanc, sprintf("This battle is over, %s! ##BThunder Neddle##b!", strcharinfo(0, "cursed player", .@rnd))); + .@msg$ = sprintf("This battle is over, %s! ##BThunder Neddle##b!", strcharinfo(0, "cursed player", .@rnd)); .@PW=35; .@SPW=5; .@RG=2; .@mtk = calcdmg(.@mob, .@rnd, HARM_MAGI); .@dmg = .@mtk * .@PW / 100; @@ -230,6 +246,7 @@ OnTimer5000: harm(.@rnd, .@dmg, HARM_MAGI, Ele_Holy); break; } + unittalk(.@mob, .@msg$); } // Always update the ratio - Terogan could have been healed diff --git a/npc/042-5/ctrl.txt b/npc/042-5/ctrl.txt index 4b51645f6..009132cc0 100644 --- a/npc/042-5/ctrl.txt +++ b/npc/042-5/ctrl.txt @@ -111,35 +111,39 @@ function monster0425 { /////////////////////////////////////////////////////////////// // This is required for others -// KamelotTreasure( POSITION ID ) +// KamelotTreasure( POSITION ID{, reward = False} ) function script KamelotTreasure { .@id=getarg(0); .@g=getcharid(2); if (.@g < 1) die(); - if ($KAMELOT_KEYMASK[.@g] & .@id) { - mesc l("The chest is unlocked and empty."); - close; - } - inventoryplace Iten, 1, NPCEyes, 2; - mesc l("Open the chest?"); - mesc l("Cost: 1 @@", getitemlink(TreasureKey)), 1; - if (!countitem(TreasureKey)) - close; - next; - if (askyesno() == ASK_NO) - close; - - delitem TreasureKey, 1; - mesc l("You open the chest!"); + inventoryplace Iten, 1, NPCEyes, 2; - .@empty=($KAMELOT_KEYMASK[.@g] & .@id); - $KAMELOT_KEYMASK[.@g]=$KAMELOT_KEYMASK[.@g]|.@id; + if (!getarg(1, false)) { + if ($KAMELOT_KEYMASK[.@g] & .@id) { + mesc l("The chest is unlocked and empty."); + close; + } + mesc l("Open the chest?"); + mesc l("Cost: 1 @@", getitemlink(TreasureKey)), 1; + if (!countitem(TreasureKey)) + close; + next; + if (askyesno() == ASK_NO) + close; + + delitem TreasureKey, 1; + mesc l("You open the chest!"); + + .@empty=($KAMELOT_KEYMASK[.@g] & .@id); + $KAMELOT_KEYMASK[.@g]=$KAMELOT_KEYMASK[.@g]|.@id; + } - if (!.@empty) { - if (.@id == $KAMELOT_KEY[.@g]) { + // Determine the reward, if it is not already looted + if (!.@empty || getarg(1, false)) { + if (.@id == $KAMELOT_KEY[.@g] && !getarg(1, false)) { dispbottom l("You found the key!"); - rentitem KamelotKey, 86400; // Ensure they expire after 24 hours + rentitem KamelotKey, 86400; // Ensure it expires after 24 hours .@key=true; } .@r=100+rand2(10000)-($KAMELOT_MX[.@g]*2)-getguildlvl(.@g); @@ -152,8 +156,12 @@ function script KamelotTreasure { else .@loot=any(SacredImmortalityPotion, DivineApple, ArcmageBoxset, GoldenApple, MercBoxA, MercBoxB, MercBoxC, MoveSpeedPotion, AtroposMixture, EverburnPowder, IridiumOre, PlatinumOre, YerbaMate, SmokeGrenade, SnakeEgg, LachesisBrew, BoneAmmoBox, GoldPieces, TerraniteOre, LeadOre, TinOre, SilverOre, GoldOre, TitaniumOre, FluoPowder, EquipmentBlueprintC, AlchemyBlueprintC, AlchemyBlueprintD, AncientBlueprint, JasmineTea, MoubooSteak, ClothoLiquor, Coal, RedPlushWine, HastePotion, CoinBag, StrengthPotion, Pearl, BronzeGift, IronOre, CopperOre, BlueDye, EquipmentBlueprintB, AlchemyBlueprintB, AlchemyBlueprintC, OolongTea, Croconut, CelestiaTea, MoubooSteak, ClothoLiquor, Coal, SmallMushroom, HastePotion, StrengthPotion, WoodenLog, LeatherPatch, DwarvenSake, EquipmentBlueprintA, EquipmentBlueprintB, AlchemyBlueprintA, SpearmintTea, TreasureMap, FatesPotion, CrazyRum, LightGreenDiamond, EarthPowder, WoodenLog, MysteriousBottle, FluoPowder, ChamomileTea, ScrollSCave); // > 70 options (~1% each) + // Announcement method depends if it has a dialog window or not + if (!getarg(1, false)) + dispbottom l("You find @@ inside!", getitemlink(.@loot)); + else + mesc l("You find @@ inside!", getitemlink(.@loot)); - mesc l("You find @@ inside!", getitemlink(.@loot)); // If itemtype == Armor/Weapon, make it guild bound and put bonus .@t=getiteminfo(.@loot, ITEMINFO_TYPE); if (.@t == IT_WEAPON) { @@ -176,6 +184,9 @@ function script KamelotTreasure { mesc l("Seems like someone else opened this chest before you!"); } + // If it is the reward prize, do not announce + if (getarg(1, false)) return; + // Announcement if (.@key) .@p$=b(" They found the key!"); |