diff options
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r-- | world/map/npc/functions/death.txt | 34 | ||||
-rw-r--r-- | world/map/npc/functions/global_event_handler.txt | 1 | ||||
-rw-r--r-- | world/map/npc/functions/mob_points.txt | 4 | ||||
-rw-r--r-- | world/map/npc/functions/rares.txt | 115 |
4 files changed, 153 insertions, 1 deletions
diff --git a/world/map/npc/functions/death.txt b/world/map/npc/functions/death.txt index 5818f315..244cb417 100644 --- a/world/map/npc/functions/death.txt +++ b/world/map/npc/functions/death.txt @@ -18,6 +18,14 @@ L_Return: return; } +function|script|HardUpdate +{ + if (BaseLevel >= 35 && getskilllv(SKILL_POOL) < 1) setskill SKILL_POOL, 1; + if (BaseLevel >= 35 && getskilllv(SKILL_SPEED) < 1) setskill SKILL_SPEED, 1; + if (BaseLevel >= 35 && getskilllv(SKILL_RAGING) < 1) setskill SKILL_RAGING, 1; + return; +} + function|script|HardKill { if (getmap(@victimrid) == "070-3") goto L_Return; @@ -34,11 +42,37 @@ L_Return: function|script|HardDeath { if (getmap() == "070-3") goto L_Return; + if (getmapflag(getmap(), MF_NOSAVE)) goto L_Absolve; + goto L_Death; + +L_Death: getinventorylist; set @item_it, 0; freeloop 1; goto L_Drop; // drop all items +L_Absolve: + set .@day, (HARDDEATH & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT; // day of week + set .@deaths, if_then_else(gettime(4) == .@day, (HARDDEATH & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT, 0); // deaths this day + set .@free, max(3, $FREEDEATHS[0]); // allowed deaths per day + + if (.@deaths >= .@free) goto L_NotAbsolved; + + set .@deaths, .@deaths + 1; + set HARDDEATH, HARDDEATH & ~(BYTE_0_MASK) | (gettime(4) << NIBBLE_0_SHIFT) | (.@deaths << NIBBLE_1_SHIFT); + set PC_DIE_COUNTER, 0; + + message strcharinfo(0), "Server : This is a special map so your death is not counted."; + message strcharinfo(0), "Server : ##BYou have " + (.@free - .@deaths) + " non-counting deaths remaining today."; + + if (.@free - .@deaths == 0) + message strcharinfo(0), "Server : ##1WARNING: if you die again today in a special map it will be PERMANENT."; + return; + +L_NotAbsolved: + message strcharinfo(0), "Server : This is a special map, however you have no more free deaths today."; + goto L_Death; + L_Drop: makeitem @inventorylist_id[@item_it], @inventorylist_amount[@item_it], getmap(), POS_X + rand(-2, 2), POS_Y + rand(-2, 2); set @item_it, @item_it + 1; diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt index 01d01e62..7af8f0e8 100644 --- a/world/map/npc/functions/global_event_handler.txt +++ b/world/map/npc/functions/global_event_handler.txt @@ -17,6 +17,7 @@ OnPCLoginEvent: callfunc "MaybeGiveBirthday"; callfunc "MiriamExpire"; // force the speed skill quest to expire callfunc "CheckDeath"; + callfunc "HardUpdate"; // add more here set @login_event, 2; end; diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt index 72b5ac23..f5308026 100644 --- a/world/map/npc/functions/mob_points.txt +++ b/world/map/npc/functions/mob_points.txt @@ -4,7 +4,7 @@ function|script|MobPoints { if (@mobID < 1002) goto L_Return; - setarray @points, + setarray @points[0], 1, // Maggot 2, // Scorpion 20, // Red Scorpion @@ -135,6 +135,8 @@ function|script|MobPoints // -o11c ; // END + void call("MaybeRare", @points[@mobID - 1002]); + if (MPQUEST == 1) set Mobpt, Mobpt + @points[@mobID - 1002]; diff --git a/world/map/npc/functions/rares.txt b/world/map/npc/functions/rares.txt new file mode 100644 index 00000000..559c4259 --- /dev/null +++ b/world/map/npc/functions/rares.txt @@ -0,0 +1,115 @@ +function|script|MaybeRare +{ + set .@chance, max(0, rand(0, 10000 + max(1, $RAREBOOST[2])) - (getarg(0) * max(1, $RAREBOOST[0])) - $RAREBOOST[1]); + if (.@chance > 0) goto L_Return; + + setarray .@rare_items$[0], + rand(5000, 5109), // sorcerer robe + "ToySabre", + "LongSword", + "AssassinBoots", + "AssassinGloves", + "AssassinShirt", + "AssassinPants", + "Halberd", + "Axe", + "BastardSword", + "Sword", + "Spear", + "RockKnife", + "IceGladius", + "WoodenStaff", + "CrimsonBra", + "TurquoiseBra", + "OrchidBra", + "GoldenWarlordPlate", + "WarlordPlate", + "ValentineDress", + "ApprenticeRobe", + "BromenalChest", + "TerraniteChestArmor", + "BlackWizardRobe", + "GoldenPlatemail", + "ScarabArmlet", + "TamOShanter", + rand(2200, 2209), // wizard hat + "Sunglasses", + "HighPriestCrown", + "TerraniteHead", + "HeartGlasses", + "PilotHat", + "GuyFawkesMask", + "TopHat", + "GroovyHat", + "DesertHelmet", + "BromenalHelmet", + "SkullMask", + rand(2230, 2239), // bowler hat brown + "Earmuffs", + "SmokingPipe", + "JesterMask", + "SnowGoggles", + "JazzyHat", + "ElfNightcap", + "EskimoHat", + "Eyepatch", + "FaceMask", + "FunkyHat", + "GoblinMask", + "Goggles", + "PanHat", + "PaladinsHelmet", + "OverlordsHelmet", + "PaperBag", + rand(2190, 2199), // rabbit ears + "WitchDoctorsMask", + "WitchHat", + "MoubooHead", + "Crown", + "ChristmasTreeHat", + "ChristmasElfHat", + "NutcrackerHat", + "OperaMask", + rand(2270, 2274), // blinking evil + "PointyWitchHat", + "PinkieHelmet", + "Monocle", + "MonsterSkullHelmet", + "MoonshroomHat", + "CarbonGasMask", + "Rednose", + "ChicSantaHat", + "ChefHat", + "Cap", + "SantaBeardHat", + "ScentedCandleHelmet", + "LeatherGoggles", + "BunnyEars", + "BunchOfParsley", + "TerraniteLegs", + "BromenalLegs", + rand(4008, 4013), // rings + "Grimoire"; + + set .@get$, .@rare_items$[rand(getarraysize(.@rare_items$))]; + set .@get, 0 + .@get$; // implicit conversion + + if (.@get > 0) + getitem .@get, 1; + elif (.@get$ != "") + getitem .@get$, 1; + else + goto L_Return; + + // unfortunately getitemlink doesn't support IDs + if (.@get > 0) + set .@link$, "@@" + .@get + "|@@"; + else + set .@link$, getitemlink(.@get$); + + announce strcharinfo(0) + " obtained a rare drop: " +.@link$, 0; + goto L_Return; + +L_Return: + return; +} |