From ab5b141ef5d6a7dc389c99297a044e15f36d2ede Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 20 Jun 2021 13:32:06 -0300 Subject: Craftmaster Day 2021 (with OP everything) --- npc/functions/event.txt | 83 ++++++++++++++++++++++++++++++++++++++++++++++ npc/functions/mobpoint.txt | 1 + 2 files changed, 84 insertions(+) (limited to 'npc') diff --git a/npc/functions/event.txt b/npc/functions/event.txt index c594bc562..970d5e04d 100644 --- a/npc/functions/event.txt +++ b/npc/functions/event.txt @@ -292,6 +292,89 @@ function script FSFDay { return; } +// CraftmasterDay() +function script CraftmasterDay { + if (!playerattached()) + return; + + // Date check + if (gettime(7) != 2021) + return; + if (gettime(6) != JUNE) + return; + if (gettime(5) != 21) + return; + if (getmap() != "018-3") + return; + + // Scored a Blue Print (2.5%) + if (rand2(10000) < 250) { + if (BaseLevel > 80 && REBIRTH) + getitem any(EquipmentBlueprintE, AlchemyBlueprintE, + EquipmentBlueprintD, AlchemyBlueprintD, + EquipmentBlueprintC, AlchemyBlueprintC, + EquipmentBlueprintB, AlchemyBlueprintB, + EquipmentBlueprintA, AlchemyBlueprintA), 1; + else if (BaseLevel > 70) + getitem any(EquipmentBlueprintD, AlchemyBlueprintD, + EquipmentBlueprintC, AlchemyBlueprintC, + EquipmentBlueprintB, AlchemyBlueprintB, + EquipmentBlueprintA, AlchemyBlueprintA), 1; + else if (BaseLevel > 45) + getitem any(EquipmentBlueprintC, AlchemyBlueprintC, + EquipmentBlueprintB, AlchemyBlueprintB, + EquipmentBlueprintA, AlchemyBlueprintA), 1; + else if (BaseLevel > 20) + getitem any(EquipmentBlueprintB, AlchemyBlueprintB, + EquipmentBlueprintA, AlchemyBlueprintA), 1; + else + getitem any(EquipmentBlueprintA, AlchemyBlueprintA), 1; + return; + } + + // Scored Monster Points (9%) + if (rand2(10000) < 900) { + .@mpt=rand2(BaseLevel*10, BaseLevel*100); // 600~6000 usually + Mobpt+=.@mpt; + dispbottom l("Acquired: %s Monster Points", fnum(.@mpt)); + return; + } + + // Autocraft (1%) + if (rand2(10000) < 100) { + .@lv=min(200, getmonsterinfo(killedrid, MOB_LV)); + .@rc=any(rand2(51, 62), 65, 66, rand2(72, 76), rand2(77, 81), 82, 98, + 99, 100, rand2(93, 97), rand2(88, 91), rand(83, 87), 92, 101, + rand2(102,117), any(122, 112), rand2(125, 134), rand2(135, 143)); + // Retrieve ID + .@it=getcraftcode(.@rc); + if (.@it <= 0) + return; + // Mark the crafting in your score variable + CRAFTING_SCORE_COMPLETE+=getiteminfo(.@it, ITEMINFO_ELV); + // Update your score book + CRAFTING_SCORE=(CRAFTING_SCORE_COMPLETE/40); + // Receive item + getitembound(.@it, 1, 1); + // Apply options if possible + if (getskilllv(TMW2_CRAFT)) { + delinventorylist(); // Needed, because we'll rely on rfind() + getinventorylist(); + .@index=array_rfind(@inventorylist_id, .@it); + + // Just to be sure, if this have an option, get something else + if (getitemoptionparambyindex(.@index, 0)) { + .@index=array_find(@inventorylist_id, .@it); + } + + callfunc("csys_Apply", .@index); + } + dispbottom l("Successfully Crafted: %s", getitemname(.@it)); + return; + } + return; +} + diff --git a/npc/functions/mobpoint.txt b/npc/functions/mobpoint.txt index 15b3a65f3..2139c02df 100644 --- a/npc/functions/mobpoint.txt +++ b/npc/functions/mobpoint.txt @@ -78,6 +78,7 @@ OnNPCKillEvent: callfunc "ChocolateDay"; callfunc "CoffeeDay"; callfunc "FSFDay"; + callfunc "CraftmasterDay"; callfunc "CadisQuestCheck"; // Unset killedrid. This affects multiple calls of this function -- cgit v1.2.3-60-g2f50