-
-
Save cydh/e1ba6cb31303ad8683fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/map/mob.c | 41 +++++++++++++++++++++++++++++++++++++++++ | |
1 file changed, 41 insertions(+) | |
diff --git a/src/map/mob.c b/src/map/mob.c | |
index e3520bf..448604b 100644 | |
--- a/src/map/mob.c | |
+++ b/src/map/mob.c | |
@@ -1875,6 +1875,46 @@ static int mob_ai_hard(int tid, unsigned int tick, int id, intptr_t data) | |
return 0; | |
} | |
+static void mob_setdropitem_adv(struct item_drop *drop) { | |
+ struct item_data *id = itemdb_exists(drop->item_data.nameid); | |
+ uint16 nameid = drop->item_data.nameid; | |
+ | |
+ if (!id) | |
+ return; | |
+ | |
+ switch (id->type) { | |
+ // Here's for Weapon | |
+ case IT_WEAPON: | |
+ // Global weapon | |
+ drop->item_data.refine = rnd()%9+1; // Add random refine | |
+ switch (nameid) { // For specified weapon | |
+ case 1716: // Gakkung [2] | |
+ if (rnd()%1000 < 100) { // 10% Chance | |
+ drop->item_data.card[0] = 0; | |
+ drop->item_data.card[1] = 0; | |
+ drop->item_data.card[2] = 4823; // Fighting_Spirit8 (enhance stone) | |
+ drop->item_data.card[3] = 4839; // Expert_Archer8 (enhance stone) | |
+ } | |
+ break; | |
+ } | |
+ break; | |
+ case IT_ARMOR: | |
+ // Global armor | |
+ drop->item_data.refine = rnd()%9+1; // Add random refine | |
+ switch (nameid) { // For specified armor | |
+ case 5035: // Poring Hat [0] | |
+ if (rnd()%1000 < 100) { // 10% Chance | |
+ drop->item_data.card[0] = 4112; // Marduk Card | |
+ drop->item_data.card[1] = 4799; // HP500 (enhance stone) | |
+ drop->item_data.card[2] = 4802; // SP150 (enhance stone) | |
+ drop->item_data.card[3] = 4807; // Atk_Speed1 (enhance stone) | |
+ } | |
+ break; | |
+ } | |
+ break; | |
+ } | |
+} | |
+ | |
/*========================================== | |
* Initializes the delay drop structure for mob-dropped items. | |
*------------------------------------------*/ | |
@@ -1885,6 +1925,7 @@ static struct item_drop* mob_setdropitem(unsigned short nameid, int qty, unsigne | |
drop->item_data.nameid = nameid; | |
drop->item_data.amount = qty; | |
drop->item_data.identify = itemdb_isidentified(nameid); | |
+ mob_setdropitem_adv(drop); | |
drop->mob_id = mob_id; | |
drop->next = NULL; | |
return drop; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment