summaryrefslogtreecommitdiff
path: root/npc/functions/event.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/event.txt')
-rw-r--r--npc/functions/event.txt83
1 files changed, 83 insertions, 0 deletions
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;
+}
+