diff options
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/aurora.txt | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt index 859bdd48f..03e5ce195 100644 --- a/npc/functions/aurora.txt +++ b/npc/functions/aurora.txt @@ -71,10 +71,14 @@ function script FYNewEvent { DelItemFromEveryPlayer(BrokenMedal); DelItemFromEveryPlayer(EventDreamTicket); DelItemFromEveryPlayer(EventNaftalin); - DelChrRegFromEveryPlayer(DTOWER_DAY); - DelChrRegFromEveryPlayer(DTOWER_ROLL); - DelChrRegFromEveryPlayer(DTOWER_FLOOR); - DelChrRegFromEveryPlayer(FYRAID_LV); + DelChrRegFromEveryPlayer("DTOWER_DAY"); + DelChrRegFromEveryPlayer("DTOWER_ROLL"); + DelChrRegFromEveryPlayer("DTOWER_FLOOR"); + DelChrRegFromEveryPlayer("FYRAID_LV"); + deletearray $FYRAID_OWNER; + deletearray $FYRAID_TIME; + deletearray $FYRAID_HP; + deletearray $FYRAID_LV; // Select the event switch ($FYEVENT_CYCLE % 12) { case 1: @@ -123,10 +127,9 @@ function script FYNewEvent { kamibroadcast("Regnum's Blessing: "+$REGNUM_BLESSMAP_H$+" is now blessed!", "Aurora Events"); break; case 10: - // FIXME: PLACEHOLDER - $EVENT$="Fishing"; - callfunc("FYEConf_Fishing"); - kamibroadcast("Catch the Golden Fish is now open!", "Aurora Events"); + $EVENT$="Raid"; + callfunc("FYEConf_Raid"); + kamibroadcast("Oh noes! "+$RAIDING_BOSS$+" is attacking our world!", "Aurora Events"); break; case 11: // FIXME: PLACEHOLDER @@ -136,7 +139,7 @@ function script FYNewEvent { default: $EVENT$="Tower"; callfunc("FYEConf_Tower"); - kamibroadcast("Dream Towers have appeared!", "Aurora Events"); + kamibroadcast($DREAMTOWER_SAGE$+"'s Dream Towers have appeared!", "Aurora Events"); break; } donpcevent "Aurora::OnRestore"; @@ -425,12 +428,42 @@ function script FYEConf_Raid { return; } -// Boss Raid Appears! +// Boss Raid Appears! (What you killed is meaningless) function script FYE_Raid { .@mob=getarg(0, killedrid); - // Obtain the monster level and roll a hidden counter - .@lv=getmonsterinfo(.@mob, MOB_LV); - DTOWER_ROLL+=.@lv; + // Actually - ignore system or auto-generated entities + if (.@mob > 1490) + return; + // Chance goes from 10% to 1% + // Defeating the boss lowers the chance in 0.1% + if (rand2(1000) > max(100-FYRAID_LV, 10)) return; + + /* A boss was found, update data */ + .@id = array_find($FYRAID_OWNER, getcharid(3)); + + // Wait - Maybe you already found a boss? + if (.@id >= 0) { + if ($FYRAID_LV[.@id] == FYRAID_LV) + return; + } + + // Never found a boss before, so assign some place for you + if (.@id < 0) { + FYRAID_LV += 1; + .@id=array_push($FYRAID_OWNER, getcharid(3)); + } + + // Assign the boss stats + $FYRAID_HP[.@id]=2000+FYRAID_LV*1000; // Also declared in 001-13/main.txt + $FYRAID_LV[.@id]=FYRAID_LV; + $FYRAID_TIME[.@id]=gettimetick(2)+3600; // One hour + + // Announce that the boss was found! + announce(l("%s: %s (Lv %d) has appeared!", b(l("BOSS WARNING")), $RAIDING_BOSS$, FYRAID_LV), bc_self); + dispbottom l("Talk to Soul Menhir to engage the boss. Time limit = 1 hour."); + // The boss is already available for anyone to kill, you get no priority + // A new boss won't show up until you visit the Soul Menhir. + // (This could be improved) return; } @@ -633,6 +666,8 @@ function script AuroraMobkill { FYE_Mining(killedrid); if ($EVENT$ == "Tower") FYE_Tower1(killedrid); + if ($EVENT$ == "Raid") + FYE_Raid(killedrid); return; } |