// TMW2 scripts. // Authors: // Jesusalva // Description: // Controls world events so Saulc and I can take vacations. // See also: seasons.txt, command/event.txt, aurora.txt // 003-1/events.txt, soulmenhir.txt and, of course, the event maps (if any). // Schedule, if needed to change, can be found in the OnInit loop. // An event, obviously, cannot last more than 7... 15 days at WORST. // Therefore, month checks aren't included in day checks. - script sPatrick NPC_HIDDEN,{ OnInit: end; } - script sDreamTower NPC_HIDDEN,{ OnWarpTo: if ($EVENT$ != "Tower") end; if (!playerattached()) end; if (!countitem(EventDreamTicket)) end; // Reset progress if (DTOWER_DAY != gettimeparam(GETTIME_DAYOFMONTH) || DTOWER_FLOOR < 1) { DTOWER_DAY=gettimeparam(GETTIME_DAYOFMONTH); DTOWER_FLOOR=1; dispbottom l("A new Dream Tower opens its gates before you..."); } // Create maze and populate CreateMaze(IOT_CHAR, MAZE_SIZE_S | MAZE_SIZE_M); MazeMobs(((BaseLevel/10) + DTOWER_FLOOR * 5), true, rand2(9,14)); // Spawn & Configure the boss monster .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; .@mob=areamonster(MAZE_MAP$, 20, 20, .@mx, .@my, "Gatekeeper", MonsterSergeant, 1, "sDreamTower::OnBossDie"); setunitdata(.@mob, UDT_LEVEL, DTOWER_FLOOR * 5); setunitdata(.@mob, UDT_STR, DTOWER_FLOOR * 2); setunitdata(.@mob, UDT_AGI, DTOWER_FLOOR * 2); setunitdata(.@mob, UDT_VIT, DTOWER_FLOOR * 3); setunitdata(.@mob, UDT_INT, DTOWER_FLOOR * 1); setunitdata(.@mob, UDT_DEX, DTOWER_FLOOR * 3); setunitdata(.@mob, UDT_LUK, DTOWER_FLOOR * 2); setunitdata(.@mob, UDT_ADELAY, max(640, 1672-(DTOWER_FLOOR * 24))); setunitdata(.@mob, UDT_MAXHP, 2000+DTOWER_FLOOR*120); setunitdata(.@mob, UDT_HP, 2000+DTOWER_FLOOR*120); setunitdata(.@mob, UDT_ATKMIN, 20+DTOWER_FLOOR*4); setunitdata(.@mob, UDT_ATKMAX, 40+DTOWER_FLOOR*4); setunitdata(.@mob, UDT_DEF, 10+DTOWER_FLOOR*3); setunitdata(.@mob, UDT_MDEF, 5+DTOWER_FLOOR); setunitdata(.@mob, UDT_HIT, (BaseLevel+DTOWER_FLOOR)*32/10); setunitdata(.@mob, UDT_FLEE, (BaseLevel+DTOWER_FLOOR)*24/10); setunitdata(.@mob, UDT_CRIT, rand2(40, min(120, 40+DTOWER_FLOOR))); // TODO: Spawn more treasure chests? (exp, gp, items) // Consume the ticket and begin the maze delitem EventDreamTicket, 1; InitMaze(3600); dispbottom col(l("Reminder : Defeat the %s to win.", b("Gatekeeper")), 2); dispbottom l("Mana Plane - Dream Tower, %dº floor. Time limit: 60 minutes or death.", DTOWER_FLOOR); end; // Dream Tower cleared OnBossDie: dispbottom l("Mana Plane - Dream Tower, %dº floor %s", DTOWER_FLOOR, b(l("CLEAR!"))); DTOWER_FLOOR+=1; if ($EVENT$ == "Tower") { if (checkweight(BrokenMedal, 1)) { getitem BrokenMedal, 1; } else { // FIXME: Can be kept for next event, a deletion is required! rodex_sendmail(getcharid(0), $DREAMTOWER_SAGE$, "You are fat.", "Here is the medal, anyway.", 0, BrokenMedal, 1); } } unitskilluseid(getcharid(3), BS_GREED, 1, getcharid(3)); sleep2(500); teleporthome(); end; } function script sThanksgiving { return; } // ChocolateDay() function script ChocolateDay { if (!playerattached()) return; // Date check if (gettime(6) != JULY) return; if (gettime(5) != 7) return; // Max. 80% chances, 0.4% per monster level .@lv=min(200, getmonsterinfo(killedrid, MOB_LV)); if (rand2(10000) < (.@lv*40)) { // Chocolate Bar: 73%; Chocolate Dye: 6.7% .@choco=any(ChocolateBar, ChocolateBar, ChocolateBar, ChocolateBar, ChocolateMouboo, ChocolateBiscuit, ChocolateBunny, ChocolateBar, ChocolateBar, ChocolateBar, ChocolateBar, ChocolateDye, ChocolateBar, ChocolateBar, ChocolateBar); getmapxy(.@m$, .@x, .@y, 0); .@x+=rand2(-1,1); .@y+=rand2(-1,1); makeitem(.@choco, 1, .@m$, .@x, .@y); } return; } // CoffeeDay() function script CoffeeDay { if (!playerattached()) return; // Date check if (gettime(6) != OCTOBER) return; if (gettime(5) != 1) return; // Max. 22% chances, 0.1% per monster level .@lv=min(200, getmonsterinfo(killedrid, MOB_LV)); if (rand2(10000) < (.@lv*11)) { getmapxy(.@m$, .@x, .@y, 0); .@x+=rand2(-1,1); .@y+=rand2(-1,1); makeitem(Coffee, 1, .@m$, .@x, .@y); } return; } // FSFDay() function script FSFDay { return; } // CraftmasterDay() function script CraftmasterDay { return; }