diff --git a/npc/re/merchants/enchan_mora.txt b/npc/re/merchants/enchan_mora.txt index aa24576e3a..55f7cdba44 100644 --- a/npc/re/merchants/enchan_mora.txt +++ b/npc/re/merchants/enchan_mora.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Euphy //===== Current Version: ===================================== -//= 1.1 +//= 1.1a //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= @@ -13,6 +13,7 @@ //===== Additional Comments: ================================= //= 1.0 First Version. [Euphy] //= 1.1 Optimized. [Euphy] +//= 1.1a Bug fixes. [Lemongrass] //============================================================ // Arch Bishop Enchants :: coin_arc @@ -1478,7 +1479,7 @@ function script F_Mora_Enchant { delitem 6380,5; //Mora_Coin delitem getarg(0),1; set .@i, rand(1,4568); - if (.@i <= 3181) { + if (.@i <= 3168) { // Basic combinations // (raw: .@i increments by 11) setarray .@enchant_slot1[0],4766,4767,4764,4765,4762,4763,4760,4761; //Atk2,Atk3,Critical5,Critical7,Evasion6,Evasion12,Matk1,Matk2 @@ -1489,6 +1490,8 @@ function script F_Mora_Enchant { .@enchant_slot2[rand(getarraysize(.@enchant_slot2))], .@enchant_slot3[rand(getarraysize(.@enchant_slot3))]; } + else if (.@i <= 3179) setarray .@enchants[1],4761,4720,4700; //Matk2 Dexterity1 Strength1 + else if (.@i <= 3181) setarray .@enchants[1],4761,4712,4712; //Matk2 Inteligence3 Inteligence3 else if (.@i <= 3183) setarray .@enchants[1],4765,4732,4732; //Critical7 Agility3 Agility3 else if (.@i <= 3185) setarray .@enchants[1],4763,4752,4753; //Evasion12 Luck3 Luck4 else if (.@i <= 3187) setarray .@enchants[1],4763,4742,4742; //Evasion12 Vitality3 Vitality3 diff --git a/src/map/script.c b/src/map/script.c index 2b313b896a..831336ae76 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6088,22 +6088,25 @@ BUILDIN_FUNC(countitem) if(sd->status.inventory[i].nameid == nameid) count += sd->status.inventory[i].amount; } else { // For countitem2() function - struct item tmp_it; - tmp_it.nameid = id->nameid; - tmp_it.identify = script_getnum(st, 3); - tmp_it.refine = script_getnum(st, 4); - tmp_it.attribute = script_getnum(st, 5); - tmp_it.card[0] = (short) script_getnum(st, 6); - tmp_it.card[1] = (short) script_getnum(st, 7); - tmp_it.card[2] = (short) script_getnum(st, 8); - tmp_it.card[3] = (short) script_getnum(st, 9); + int nameid, iden, ref, attr, c1, c2, c3, c4; - for (i = 0; i < MAX_INVENTORY; i++) - if ((&sd->status.inventory[i] != NULL) - && sd->status.inventory[i].amount > 0 - && compare_item(&sd->status.inventory[i], &tmp_it) - ) - count += sd->status.inventory[i].amount; + nameid = id->nameid; + iden = script_getnum(st,3); + ref = script_getnum(st,4); + attr = script_getnum(st,5); + c1 = (short)script_getnum(st,6); + c2 = (short)script_getnum(st,7); + c3 = (short)script_getnum(st,8); + c4 = (short)script_getnum(st,9); + + for(i = 0; i < MAX_INVENTORY; i++) + if (sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] != NULL && + sd->status.inventory[i].amount > 0 && sd->status.inventory[i].nameid == nameid && + sd->status.inventory[i].identify == iden && sd->status.inventory[i].refine == ref && + sd->status.inventory[i].attribute == attr && sd->status.inventory[i].card[0] == c1 && + sd->status.inventory[i].card[1] == c2 && sd->status.inventory[i].card[2] == c3 && + sd->status.inventory[i].card[3] == c4 ) + count += sd->status.inventory[i].amount; } script_pushint(st,count); diff --git a/src/map/unit.c b/src/map/unit.c index fa7b627b3c..f0bff0332f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -137,13 +137,15 @@ int* unit_get_masterteleport_timer(struct block_list *bl){ } int unit_teleport_timer(int tid, unsigned int tick, int id, intptr_t data){ + struct block_list *bl = map_id2bl(id); + int *mast_tid = unit_get_masterteleport_timer(bl); + if(tid == INVALID_TIMER) return 0; + else if(*mast_tid && *mast_tid != tid) + return 0; else { - struct block_list *bl = map_id2bl(id); - int *mast_tid = unit_get_masterteleport_timer(bl); TBL_PC *msd = unit_get_master(bl); - switch(data){ case BL_HOM: case BL_ELEM: