diff options
-rw-r--r-- | .travis.yml | 47 | ||||
-rw-r--r-- | conf/map/battle/skill.conf | 5 | ||||
-rw-r--r-- | doc/constants.md | 14 | ||||
-rw-r--r-- | doc/script_commands.txt | 34 | ||||
-rw-r--r-- | npc/other/Global_Functions.txt | 28 | ||||
-rw-r--r-- | npc/re/jobs/3-1/archbishop.txt | 12 | ||||
-rw-r--r-- | npc/re/jobs/3-1/ranger.txt | 4 | ||||
-rw-r--r-- | npc/re/quests/eden/eden_tutorial.txt | 2 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 95 | ||||
-rw-r--r-- | src/map/script.h | 17 | ||||
-rw-r--r-- | src/map/skill.c | 15 | ||||
-rwxr-xr-x | tools/ci/travis.sh | 8 |
14 files changed, 205 insertions, 79 deletions
diff --git a/.travis.yml b/.travis.yml index a9bea834d..b29668da3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ install: before_script: - uname -a + - ulimit -c unlimited -S - ./tools/ci/travis.sh createdb ragnarok root - ./tools/ci/travis.sh importdb ragnarok root - ./tools/ci/travis.sh adduser ragnarok travis travis root @@ -44,6 +45,7 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-6 - doxygen - libxml-simple-perl @@ -57,6 +59,7 @@ matrix: - llvm-toolchain-trusty-5.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-5.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --disable-renewal --enable-Werror --enable-buildbot" @@ -66,6 +69,7 @@ matrix: - llvm-toolchain-trusty-5.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-5.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" @@ -75,6 +79,7 @@ matrix: - llvm-toolchain-trusty-4.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-4.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20130724 --enable-packetver-re --enable-buildbot" @@ -84,6 +89,7 @@ matrix: - llvm-toolchain-trusty-4.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-4.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --disable-renewal --enable-Werror --enable-buildbot" @@ -93,6 +99,7 @@ matrix: - llvm-toolchain-trusty-4.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-4.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-buildbot" @@ -109,6 +116,7 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-5 - compiler: gcc env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" @@ -117,6 +125,7 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-5 - compiler: gcc env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" @@ -125,6 +134,7 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-6 - compiler: gcc env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" @@ -133,7 +143,44 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-6 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-7 --disable-manager --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-7 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-7 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-7 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-8 --disable-manager --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-8 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-8 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-8 notifications: email: false diff --git a/conf/map/battle/skill.conf b/conf/map/battle/skill.conf index 64bba68b5..da8d1906d 100644 --- a/conf/map/battle/skill.conf +++ b/conf/map/battle/skill.conf @@ -330,3 +330,8 @@ bowling_bash_area: 0 // punch a hole into SG it will for example create a "suck in" effect. // If you disable this setting, the knockback direction will be completely random (eAthena style). stormgust_knockback: true + +// Magic Rod's animation behavior (Note 1) +// 0 : (official) Magic Rod's animation occurs every time it is used. +// 1 : Magic Rod's animation would not occur unless a spell was absorbed. (old behavior) +magicrod_type: 0 diff --git a/doc/constants.md b/doc/constants.md index 8b3acbfdf..5a98d18bb 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -3991,6 +3991,8 @@ - `MAX_REFINE`: 20 - `MAX_MENU_OPTIONS`: 255 - `MAX_MENU_LENGTH`: 2048 +- `MOB_CLONE_START`: 4001 +- `MOB_CLONE_END`: 5000 ### status options @@ -4280,6 +4282,18 @@ - `ITEMINFO_VIEWSPRITE`: 16 - `ITEMINFO_TRADE`: 17 +### getmercinfo options + +- `MERCINFO_ID,`: 0 +- `MERCINFO_CLASS`: 1 +- `MERCINFO_NAME`: 2 +- `MERCINFO_FAITH`: 3 +- `MERCINFO_CALLS`: 4 +- `MERCINFO_KILLCOUNT`: 5 +- `MERCINFO_LIFETIME`: 6 +- `MERCINFO_LEVEL`: 7 +- `MERCINFO_GID`: 8 + ### monster skill states - `MSS_ANY`: -1 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a4b9ec717..9655e907c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -718,6 +718,8 @@ MAX_CHAT_USERS - Maximum Chat users MAX_REFINE - Maximum Refine level MAX_MENU_OPTIONS - Maximum NPC menu options MAX_MENU_LENGTH - Maximum NPC menu string length +MOB_CLONE_START - Clone ID start from this range +MOB_CLONE_END - Clone ID end with this range Send targets and status options are also hard-coded and can be found in 'doc/constants.md'. @@ -6332,7 +6334,7 @@ Examples: setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL, true); // Re-enables attack, skills and item use - setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM, false); + setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM, false); // checkpcblock related checks if ((checkpcblock() & PCBLOCK_IMMUNE) != 0) @@ -9635,6 +9637,11 @@ is run when they relog. <On Death Event> refers to an NPC label that attaches to the character and is run when they die. Can be "" for empty. +If "-" is supplied for <mapname>, this will remove the 1 second automatic +respawn on the battleground map. This allows for better manipulation of +<On Death Event>. The player will have to be warped to desired location +at the end of <On Death Event>. + Unlike the prior command, the latter will attach a GROUP in a waiting room to the battleground, and sets the array $@arenamembers[0] where 0 holds the IDs of the first group, and 1 holds the IDs of the second. @@ -9766,6 +9773,8 @@ mapflag%TAB%<map_name>%TAB%battleground%TAB%2 This command will create a new BG Team. When player dies, they will be respawned map_name,X,Y as mentioned. +If "-" is supplied for the map name, this will remove the 1 second automatic +respawn on the battleground map. Command will return -1 if BG Creation is failed, else it will return the BG ID(Also known as TeamID). @@ -9855,17 +9864,18 @@ If char id is given, the information of that character is retrieved instead. Type specifies what information to retrieve and can be one of the following: - 0 - Database ID - 1 - Class - 2 - Name - 3 - Faith value for this mercenary's guild, if any - 4 - Calls value for this mercenary's guild, if any - 5 - Kill count - 6 - Remaining life time in msec - 7 - Level - -If the character does not have a mercenary, the command returns "" -for name and 0 for all other types. + MERCINFO_ID - Mercenary Database ID + MERCINFO_CLASS - Mercenary Class + MERCINFO_NAME - Mercenary Name + MERCINFO_FAITH - Mercenary faith value for this mercenary's guild, if any + MERCINFO_CALLS - Mercenary calls value for this mercenary's guild, if any + MERCINFO_KILLCOUNT - Mercenary kill count + MERCINFO_LIFETIME - Mercenary remaining life time in mili-second + MERCINFO_LEVEL - Mercenary Level + MERCINFO_GID - Mercenary Game ID + +If the character does not have a mercenary, the command returns "" for MERCINFO_NAME +and 0 for all other types. --------------------------------------- //===================================== diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index 904ed7165..86332e931 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -446,32 +446,24 @@ function script F_MesColor { function script F_GetTradeRestriction { .@trade = getiteminfo(getarg(0), ITEMINFO_TRADE); - if (.@trade == 0) { + if (.@trade == 0) return "None"; - } .@trade$ = ""; - if (.@trade & ITR_NODROP) { + if (.@trade & ITR_NODROP) .@trade$ += "NoDrop|"; - } - if (.@trade & ITR_NOTRADE) { + if (.@trade & ITR_NOTRADE) .@trade$ += "NoTrade|"; - } - if (.@trade & ITR_PARTNEROVERRIDE) { + if (.@trade & ITR_PARTNEROVERRIDE) .@trade$ += "PartnerOverride|"; - } - if (.@trade & ITR_NOSELLTONPC) { + if (.@trade & ITR_NOSELLTONPC) .@trade$ += "NoSellToNpc|"; - } - if (.@trade & ITR_NOSTORAGE) { + if (.@trade & ITR_NOSTORAGE) .@trade$ += "NoStorage|"; - } - if (.@trade & ITR_NOGSTORAGE) { + if (.@trade & ITR_NOGSTORAGE) .@trade$ += "NoGuildStorage|"; - } - if (.@trade & ITR_NOMAIL) { + if (.@trade & ITR_NOMAIL) .@trade$ += "NoMail|"; - } - if (.@trade & ITR_NOAUCTION) { + if (.@trade & ITR_NOAUCTION) .@trade$ += "NoAuction|"; - } + return .@trade$; } diff --git a/npc/re/jobs/3-1/archbishop.txt b/npc/re/jobs/3-1/archbishop.txt index e59492ce5..e37087857 100644 --- a/npc/re/jobs/3-1/archbishop.txt +++ b/npc/re/jobs/3-1/archbishop.txt @@ -779,7 +779,7 @@ job3_arch01,29,34,3 script Valkyrie#arch 4_F_VALKYRIE2,{ warp "odin_tem02",282,263; end; } - if (getmercinfo(1)) { + if (getmercinfo(MERCINFO_CLASS)) { mes "[Valkyrie]"; mes "If you want to talk with me, you have to ^3131FFcancel all contracts^000000 with any mercenaries you have."; close; @@ -1006,7 +1006,7 @@ OnTouch: if (countitem(ValkyrieA_Scroll)) { delitem ValkyrieA_Scroll,1; // fall through - } else if (getmercinfo(1) == 2037) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_A) { if (strnpcinfo(NPC_NAME) == "#arch_1_10") viewpoint 1,113,327,1,0xFF9900; .@randht = rand(1,10); @@ -1038,7 +1038,7 @@ OnTouch: if (countitem(ValkyrieA_Scroll)) { delitem ValkyrieA_Scroll,1; // fall through - } else if (getmercinfo(1) == 2037) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_A) { mapannounce "job3_arch02","Valkyrie's Nightmare: An incompetent illusion of Valkyrie came here with the assistance of humans. You wanna have that nightmare?",bc_map,"0xFF0000"; donpcevent "mob#arch_1::OnKill"; end; @@ -1113,7 +1113,7 @@ OnKill: } job3_arch02,113,327,5 script Valkyrie#arch_01 4_F_VALKYRIE2,{ - if (getmercinfo(1)) { + if (getmercinfo(MERCINFO_CLASS)) { mes "[Valkyrie]"; mes "If you want to talk with me, you have to ^3131FFcancel all contracts^000000 with any mercenaries you have."; close; @@ -1355,7 +1355,7 @@ OnTouch: if (countitem(ValkyrieB_Scroll)) { delitem ValkyrieB_Scroll,1; // fall through - } else if (getmercinfo(1) == 2038) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_B) { .@randht = rand(1,10); if (.@randht < 8) mapannounce "job3_arch02","Whispering of an impersonation: I can feel the devil's spirits. Can you hear? The sound of gathering in crowds.",bc_map,"0xFFCE00"; @@ -1400,7 +1400,7 @@ OnTouch: if (countitem(ValkyrieB_Scroll)) { delitem ValkyrieB_Scroll,1; // fall through - } else if (getmercinfo(1) == 2038) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_B) { mapannounce "job3_arch02","A shout of devil: You are so childish. I invite you a party of devil. I'll make you have a fun!",bc_map,"0xFF0000"; end; } diff --git a/npc/re/jobs/3-1/ranger.txt b/npc/re/jobs/3-1/ranger.txt index 41e5b476f..166a1d42e 100644 --- a/npc/re/jobs/3-1/ranger.txt +++ b/npc/re/jobs/3-1/ranger.txt @@ -613,7 +613,7 @@ tur_dun01,91,169,3 script Test Instructor#jr02 4_M_JOB_HUNTER,{ mes "Don't hang around here doing nothing. This is my area!"; close; L_Start: - if (getmercinfo(1)) { + if (getmercinfo(MERCINFO_CLASS)) { mes "[Test Instructor, Teardrop]"; mes "Stop!"; next; @@ -1491,7 +1491,7 @@ job3_rang02,251,49,3 script Test Supervisor#jr_13 4_M_JOB_HUNTER,{ setquest 8261; close; } - if (getmercinfo(1) == 2034) { + if (getmercinfo(MERCINFO_CLASS) == M_DESERT_WOLF_B) { erasequest 8261; mes "Good! Then I'll start the test right now!"; next; diff --git a/npc/re/quests/eden/eden_tutorial.txt b/npc/re/quests/eden/eden_tutorial.txt index 902db7945..188bc514a 100644 --- a/npc/re/quests/eden/eden_tutorial.txt +++ b/npc/re/quests/eden/eden_tutorial.txt @@ -228,7 +228,7 @@ moc_para01,34,178,3 script Tutorial Instructor 4_M_KHMAN,{ close; } } else if (questprogress(9167) == 1) { - if (!getmercinfo(1)) { + if (!getmercinfo(MERCINFO_CLASS)) { mes "[Tutorial Instructor]"; mes "You haven't gotten a mercenary yet."; next; diff --git a/src/map/battle.c b/src/map/battle.c index 6fa46a7c7..1b7bf909e 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7413,6 +7413,7 @@ static const struct battle_data { { "min_item_buy_price", &battle_config.min_item_buy_price, 1, 0, INT_MAX, }, { "min_item_sell_price", &battle_config.min_item_sell_price, 0, 0, INT_MAX, }, { "display_fake_hp_when_dead", &battle_config.display_fake_hp_when_dead, 1, 0, 1, }, + { "magicrod_type", &battle_config.magicrod_type, 0, 0, 1, }, }; static bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index d2fd92450..c797e665a 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -576,6 +576,8 @@ struct Battle_Config { int min_item_sell_price; int display_fake_hp_when_dead; + + int magicrod_type; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/script.c b/src/map/script.c index 736b442cc..23793e54a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -15640,20 +15640,15 @@ static BUILDIN(gethominfo) return true; } -/// Retrieves information about character's mercenary -/// getmercinfo <type>[,<char id>]; +/* + * Retrieves information about character's mercenary + * getmercinfo <type>{, <char id> }; + */ static BUILDIN(getmercinfo) { - int type; - struct map_session_data* sd; - struct mercenary_data* md; - - type = script_getnum(st,2); - - if (script_hasdata(st,3)) { - int char_id = script_getnum(st,3); - - if ((sd = script->charid2sd(st, char_id)) == NULL) { + struct map_session_data *sd; + if (script_hasdata(st, 3)) { + if ((sd = script->charid2sd(st, script_getnum(st, 3))) == NULL) { script_pushnil(st); return true; } @@ -15662,27 +15657,48 @@ static BUILDIN(getmercinfo) return true; } - md = ( sd->status.mer_id && sd->md ) ? sd->md : NULL; + struct mercenary_data *md = (sd->status.mer_id && sd->md)? sd->md : NULL; + int type = script_getnum(st, 2); + if (md == NULL) { + if (type == MERCINFO_NAME) + script_pushconststr(st, ""); + else + script_pushint(st, 0); + return true; + } - switch( type ) - { - case 0: script_pushint(st,md ? md->mercenary.mercenary_id : 0); break; - case 1: script_pushint(st,md ? md->mercenary.class_ : 0); break; - case 2: - if( md ) - script_pushstrcopy(st,md->db->name); - else - script_pushconststr(st,""); - break; - case 3: script_pushint(st,md ? mercenary->get_faith(md) : 0); break; - case 4: script_pushint(st,md ? mercenary->get_calls(md) : 0); break; - case 5: script_pushint(st,md ? md->mercenary.kill_count : 0); break; - case 6: script_pushint(st,md ? mercenary->get_lifetime(md) : 0); break; - case 7: script_pushint(st,md ? md->db->lv : 0); break; - default: - ShowError("buildin_getmercinfo: Invalid type %d (char_id=%d).\n", type, sd->status.char_id); - script_pushnil(st); - return false; + switch (type) { + case MERCINFO_ID: + script_pushint(st, md->mercenary.mercenary_id); + break; + case MERCINFO_CLASS: + script_pushint(st, md->mercenary.class_); + break; + case MERCINFO_NAME: + script_pushstrcopy(st, md->db->name); + break; + case MERCINFO_FAITH: + script_pushint(st, mercenary->get_faith(md)); + break; + case MERCINFO_CALLS: + script_pushint(st, mercenary->get_calls(md)); + break; + case MERCINFO_KILLCOUNT: + script_pushint(st, md->mercenary.kill_count); + break; + case MERCINFO_LIFETIME: + script_pushint(st, mercenary->get_lifetime(md)); + break; + case MERCINFO_LEVEL: + script_pushint(st, md->db->lv); + break; + case MERCINFO_GID: + script_pushint(st, md->bl.id); + break; + default: + ShowError("buildin_getmercinfo: Invalid type %d (char_id=%d).\n", type, sd->status.char_id); + script_pushnil(st); + return false; } return true; @@ -23714,7 +23730,7 @@ static BUILDIN(bg_create_team) if( strcmp(map_name,"-") != 0 ) { map_index = script->mapindexname2id(st,map_name); if( map_index == 0 ) { // Invalid Map - script_pushint(st,0); + script_pushint(st, -1); return true; } } @@ -25874,6 +25890,8 @@ static void script_hardcoded_constants(void) script->set_constant("MAX_REFINE",MAX_REFINE,false, false); script->set_constant("MAX_MENU_OPTIONS", MAX_MENU_OPTIONS, false, false); script->set_constant("MAX_MENU_LENGTH", MAX_MENU_LENGTH, false, false); + script->set_constant("MOB_CLONE_START", MOB_CLONE_START, false, false); + script->set_constant("MOB_CLONE_END", MOB_CLONE_END, false, false); script->constdb_comment("status options"); script->set_constant("Option_Nothing",OPTION_NOTHING,false, false); @@ -26145,6 +26163,17 @@ static void script_hardcoded_constants(void) script->set_constant("ITEMINFO_VIEWSPRITE", ITEMINFO_VIEWSPRITE, false, false); script->set_constant("ITEMINFO_TRADE", ITEMINFO_TRADE, false, false); + script->constdb_comment("getmercinfo options"); + script->set_constant("MERCINFO_ID,", MERCINFO_ID, false, false); + script->set_constant("MERCINFO_CLASS", MERCINFO_CLASS, false, false); + script->set_constant("MERCINFO_NAME", MERCINFO_NAME, false, false); + script->set_constant("MERCINFO_FAITH", MERCINFO_FAITH, false, false); + script->set_constant("MERCINFO_CALLS", MERCINFO_CALLS, false, false); + script->set_constant("MERCINFO_KILLCOUNT", MERCINFO_KILLCOUNT, false, false); + script->set_constant("MERCINFO_LIFETIME", MERCINFO_LIFETIME, false, false); + script->set_constant("MERCINFO_LEVEL", MERCINFO_LEVEL, false, false); + script->set_constant("MERCINFO_GID", MERCINFO_GID, false, false); + script->constdb_comment("monster skill states"); script->set_constant("MSS_ANY", MSS_ANY, false, false); script->set_constant("MSS_IDLE", MSS_IDLE, false, false); diff --git a/src/map/script.h b/src/map/script.h index 549ad3284..54c5aad2a 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -461,6 +461,23 @@ enum script_iteminfo_types { }; /** + * Mercenary Info types. + */ +enum script_mercinfo_types { + MERCINFO_ID = 0, + MERCINFO_CLASS, + MERCINFO_NAME, + MERCINFO_FAITH, + MERCINFO_CALLS, + MERCINFO_KILLCOUNT, + MERCINFO_LIFETIME, + MERCINFO_LEVEL, + MERCINFO_GID, + + MERCINFO_MAX +}; + +/** * Player blocking actions related flags. */ enum pcblock_action_flag { diff --git a/src/map/skill.c b/src/map/skill.c index 069db55df..633a73d67 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2892,14 +2892,16 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li } #endif /* MAGIC_REFLECTION_TYPE */ } - if(sc && sc->data[SC_MAGICROD] && src == dsrc) { - int sp = skill->get_sp(skill_id,skill_lv); + if (sc && sc->data[SC_MAGICROD] && src == dsrc) { + int sp = skill->get_sp(skill_id, skill_lv); dmg.damage = dmg.damage2 = 0; dmg.dmg_lv = ATK_MISS; //This will prevent skill additional effect from taking effect. [Skotlex] sp = sp * sc->data[SC_MAGICROD]->val2 / 100; - if(skill_id == WZ_WATERBALL && skill_lv > 1) - sp = sp/((skill_lv|1)*(skill_lv|1)); //Estimate SP cost of a single water-ball + if (skill_id == WZ_WATERBALL && skill_lv > 1) + sp = sp / ((skill_lv | 1) * (skill_lv | 1)); //Estimate SP cost of a single water-ball status->heal(bl, 0, sp, STATUS_HEAL_SHOWEFFECT); + if (battle->bc->magicrod_type == 1) + clif->skill_nodamage(bl, bl, SA_MAGICROD, sc->data[SC_MAGICROD]->val1, 1); // Animation used here in eAthena [Wolfie] } } @@ -7881,8 +7883,9 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * } break; case SA_MAGICROD: - clif->skill_nodamage(src,src,SA_MAGICROD,skill_lv,1); - sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)); + if (battle->bc->magicrod_type == 0) + clif->skill_nodamage(src, src, SA_MAGICROD, skill_lv, 1); // Animation used here in official [Wolfie] + sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)); break; case SA_AUTOSPELL: clif->skill_nodamage(src,bl,skill_id,skill_lv,1); diff --git a/tools/ci/travis.sh b/tools/ci/travis.sh index fa7d5be93..22f523bdf 100755 --- a/tools/ci/travis.sh +++ b/tools/ci/travis.sh @@ -47,7 +47,8 @@ function aborterror { function run_server { echo "Running: $1 --run-once $2" - $1 --run-once $2 2>runlog.txt + rm -rf core* || true + CRASH_PLEASE=1 $1 --run-once $2 2>runlog.txt export errcode=$? export teststr=$(head -c 10000 runlog.txt) if [[ -n "${teststr}" ]]; then @@ -59,12 +60,17 @@ function run_server { fi if [ ${errcode} -ne 0 ]; then echo "server $1 terminated with exit code ${errcode}" + COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) + if [[ -f "$COREFILE" ]]; then + gdb -c "$COREFILE" $1 -ex "thread apply all bt" -ex "set pagination 0" -batch + fi aborterror "Test failed" fi } function run_test { echo "Running: test_$1" + sysctl -w kernel.core_pattern=core || true ./test_$1 2>runlog.txt export errcode=$? export teststr=$(head -c 10000 runlog.txt) |