Skip to content
Permalink
Browse files
Merged Monster Transformation update from Hercules (9692bc0) - Merge …
…credits to Aleos & Cydh

-> Applied follow-up for using monster IDs with the commands (ead2a83)
Merged revert of r15787 where character must face north (5188b69)
Merged bug fix for visual effects on relog (f304c36)
-> This fixes the Warlock Sphere issue on relog as well as many other visual effects

Applied a possible map crash fix - Credits ivanyan
http://rathena.org/board/tracker/issue-8212-server-crash-guild-retrieveitembound/

Started working on some source code documentation
Renamed bank update SQL file to upgrade_20131105.sql
  • Loading branch information
tgraskemper committed Nov 6, 2013
1 parent 3d72c51 commit 9c438ce762c392bf0731d34b85d3c9de93341f8e
@@ -124,3 +124,7 @@ cashshop_show_points: no
// 1 = Yes
// 2 = Yes, when there are unread mails
mail_show_status: 0

// Is monster transformation disabled during Guild Wars?
// If set to yes, monster transforming is automatically removed/disabled when enterting castles during WoE times
mon_trans_disable_in_gvg: no
@@ -1506,5 +1506,11 @@
1495: You can't withdraw that much money
1496: Banking is disabled

// Monster Transformation
1497: Traaaansformation-!! %s form!!
1498: Cannot transform into monster while in disguise.
1499: Character cannot be disguised while in monster form.
1500: Transforming into monster is not allowed in Guild Wars.

//Custom translations
//import: conf/msg_conf/import/map_msg_eng_conf.txt
@@ -1340,7 +1340,12 @@ SC_ANTI_M_BLAST 577
SC_B_TRAP 578
SC_H_MINE 579
SC_QD_SHOT_READY 580
SC_EXTREMITYFIST2 581
SC_MTF_ASPD 581
SC_MTF_RANGEATK 582
SC_MTF_MATK 583
SC_MTF_MLEATKED 584
SC_MTF_CRIDAMAGE 585
SC_EXTREMITYFIST2 586

e_gasp 0
e_what 1
@@ -5983,13 +5983,13 @@
12655,Brain_Powder,Brain Powder,2,2000,,100,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12656,Magical_Powder,Magical Powder,2,3000,,200,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12657,Madness_Powder,Madness Powder,2,4000,,300,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12658,Trans_Scroll_Devi,Transformation Scroll(Deviruchi),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12659,Trans_Scroll_Ray_Arch,Transformation Scroll(Raydric),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12660,Trans_Scroll_Mavka,Transformation Scroll(Mavka),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12661,Trans_Scroll_Marduk,Transformation Scroll(Marduk),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12662,Trans_Scroll_Banshee,Transformation Scroll(Banshee),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12663,Trans_Scroll_Poring,Transformation Scroll(Poring),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12664,Trans_Scroll_Golem,Transformation Scroll(Golem),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12658,Trans_Scroll_Devi,Transformation Scroll(Deviruchi),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Deviruchi",1200000,SC_MTF_ASPD; },{},{}
12659,Trans_Scroll_Ray_Arch,Transformation Scroll(Raydric),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Raydric Archer",1200000,SC_MTF_RANGEATK; },{},{}
12660,Trans_Scroll_Mavka,Transformation Scroll(Mavka),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Mavka",1200000,SC_MTF_RANGEATK; },{},{}
12661,Trans_Scroll_Marduk,Transformation Scroll(Marduk),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Marduk",1200000,SC_MTF_MATK; },{},{}
12662,Trans_Scroll_Banshee,Transformation Scroll(Banshee),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Banshee",1200000,SC_MTF_MATK; },{},{}
12663,Trans_Scroll_Poring,Transformation Scroll(Poring),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Poring",1200000,SC_MTF_CRIDAMAGE; },{},{}
12664,Trans_Scroll_Golem,Transformation Scroll(Golem),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform "Golem",1200000,SC_MTF_MLEATKED; },{},{}
12665,Grovel_Buff,Grovel Buff,2,0,,0,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12666,Thai_Perfume_MATK,Thai Perfume MATK,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
12667,Thai_Perfume_ATK,Thai Perfume ATK,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
@@ -23,6 +23,14 @@
11524,3000 // White_Raffle_Sap
11525,5000 // Mora_Hip_Tea

12658, 10000 // Transformation Scroll(Deviruchi)
12659, 10000 // Transformation Scroll(Raydric)
12660, 10000 // Transformation Scroll(Mavka)
12661, 10000 // Transformation Scroll(Marduk)
12662, 10000 // Transformation Scroll(Banshee)
12663, 10000 // Transformation Scroll(Poring)
12664, 10000 // Transformation Scroll(Golem)

// FIX ME! Delays need confirmation.
12968,300000 // Emergency_Scroll1
12969,300000 // Emergency_Scroll2
@@ -6014,13 +6014,13 @@ REPLACE INTO `item_db_re` VALUES (12654,'Lucky_Egg_C9','Lucky Egg C9',2,20,NULL,
REPLACE INTO `item_db_re` VALUES (12655,'Brain_Powder','Brain Powder',2,2000,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12656,'Magical_Powder','Magical Powder',2,3000,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12657,'Madness_Powder','Madness Powder',2,4000,NULL,300,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12658,'Trans_Scroll_Devi','Transformation Scroll(Deviruchi)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12659,'Trans_Scroll_Ray_Arch','Transformation Scroll(Raydric)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12660,'Trans_Scroll_Mavka','Transformation Scroll(Mavka)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12661,'Trans_Scroll_Marduk','Transformation Scroll(Marduk)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12662,'Trans_Scroll_Banshee','Transformation Scroll(Banshee)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12663,'Trans_Scroll_Poring','Transformation Scroll(Poring)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12664,'Trans_Scroll_Golem','Transformation Scroll(Golem)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12658,'Trans_Scroll_Devi','Transformation Scroll(Deviruchi)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Deviruchi",1200000,SC_MTF_ASPD;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12659,'Trans_Scroll_Ray_Arch','Transformation Scroll(Raydric)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Raydric Archer",1200000,SC_MTF_RANGEATK;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12660,'Trans_Scroll_Mavka','Transformation Scroll(Mavka)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Mavka",1200000,SC_MTF_RANGEATK;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12661,'Trans_Scroll_Marduk','Transformation Scroll(Marduk)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Marduk",1200000,SC_MTF_MATK;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12662,'Trans_Scroll_Banshee','Transformation Scroll(Banshee)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Banshee",1200000,SC_MTF_MATK;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12663,'Trans_Scroll_Poring','Transformation Scroll(Poring)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Poring",1200000,SC_MTF_CRIDAMAGE;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12664,'Trans_Scroll_Golem','Transformation Scroll(Golem)',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'transform "Golem",1200000,SC_MTF_MLEATKED;',NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12665,'Grovel_Buff','Grovel Buff',2,0,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12666,'Thai_Perfume_MATK','Thai Perfume MATK',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db_re` VALUES (12667,'Thai_Perfume_ATK','Thai Perfume ATK',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
File renamed without changes.
@@ -47,8 +47,7 @@
// 20120307 - 2012-03-07aRagexeRE+ - 0x970

#ifndef PACKETVER
#define PACKETVER 20130724
//#define PACKETVER 20130320
#define PACKETVER 20130807
//#define PACKETVER 20120410
#endif

@@ -4828,6 +4828,11 @@ ACMD_FUNC(disguise)
return -1;
}

if (sd->sc.data[SC_MONSTER_TRANSFORM]) {
clif_displaymessage(fd, msg_txt(sd,1499)); // Character cannot be disguised while in monster transform.
return -1;
}

pc_disguise(sd, id);
clif_displaymessage(fd, msg_txt(sd,122)); // Disguise applied.

@@ -3896,6 +3896,11 @@ struct Damage battle_attack_sc_bonus(struct Damage wd, struct block_list *src, u
ATK_ADD(wd.damage, wd.damage2, sc->data[SC_P_ALTER]->val2);
RE_ALLATK_ADD(wd, sc->data[SC_P_ALTER]->val2);
}
// Monster Transformation bonus
if(wd.flag&BF_LONG && sc->data[SC_MTF_RANGEATK]) {
ATK_ADD(wd.damage, wd.damage2, 25);
RE_ALLATK_ADD(wd, 25);
}
}
return wd;
}
@@ -4646,8 +4651,11 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl

#ifdef RENEWAL
if(is_attack_critical(wd, src, target, skill_id, skill_lv, false)) {
if(sd) // check for player so we don't crash out, monsters don't have bonus crit rates [helvetica]
if(sd) { // check for player so we don't crash out, monsters don't have bonus crit rates [helvetica]
wd.damage = (int)floor((double)(wd.damage * 1.4 * (100 + sd->bonus.crit_atk_rate)) / 100);
if (sc && sc->data[SC_MTF_CRIDAMAGE]) // Monster Transformation Bonus
wd.damage *= (int)1.25;
}
else
wd.damage = (int)floor((double)wd.damage * 1.4);
}
@@ -6180,6 +6188,8 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
return ATK_DEF;
return ATK_MISS;
}
if (tsc && tsc->data[SC_MTF_MLEATKED] && rnd()%100 < 20)
clif_skill_nodamage(target, target, SM_ENDURE, 5, sc_start(src, target, SC_ENDURE, 100, 5, skill_get_time(SM_ENDURE, 5)));
}

if(tsc && tsc->data[SC_KAAHI] && tsc->data[SC_KAAHI]->val4 == INVALID_TIMER && tstatus->hp < tstatus->max_hp)
@@ -7224,6 +7234,7 @@ static const struct _battle_data {
{ "bowling_bash_area", &battle_config.bowling_bash_area, 0, 0, 20, },
{ "drop_rateincrease", &battle_config.drop_rateincrease, 0, 0, 1, },
{ "feature.banking", &battle_config.feature_banking, 1, 0, 1, },
{ "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
@@ -495,6 +495,7 @@ extern struct Battle_Config
int bowling_bash_area;
int drop_rateincrease;
int feature_banking;
int mon_trans_disable_in_gvg;

} battle_config;

@@ -1345,6 +1345,15 @@ int clif_spawn(struct block_list *bl)
#endif
if (sd->status.robe)
clif_refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);

if( sd->sc.data[SC_CAMOUFLAGE] )
clif_status_load(bl,SI_CAMOUFLAGE,1);
if( sd->sc.data[SC_MONSTER_TRANSFORM] )
clif_status_change(bl,SI_MONSTER_TRANSFORM,1,0,sd->sc.data[SC_MONSTER_TRANSFORM]->val1,0,0);
if( sd->sc.data[SC_MOONSTAR] )
clif_status_load(bl,SI_MOONSTAR,1);
if( sd->sc.data[SC_SUPER_STAR] )
clif_status_load(bl,SI_SUPER_STAR,1);
}
break;
case BL_MOB:
@@ -4156,10 +4165,17 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
clif_specialeffect_single(bl,421,sd->fd);
if( tsd->bg_id && map[tsd->bl.m].flag.battleground )
clif_sendbgemblem_single(sd->fd,tsd);
if( tsd->sc.data[SC_CAMOUFLAGE] )
clif_status_load(bl,SI_CAMOUFLAGE,1);
if ( tsd->status.robe )
clif_refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);

if( tsd->sc.data[SC_CAMOUFLAGE] )
clif_status_load(bl,SI_CAMOUFLAGE,1);
if( tsd->sc.data[SC_MONSTER_TRANSFORM] )
clif_status_change(bl,SI_MONSTER_TRANSFORM,1,0,tsd->sc.data[SC_MONSTER_TRANSFORM]->val1,0,0);
if( tsd->sc.data[SC_MOONSTAR] )
clif_status_load(bl,SI_MOONSTAR,1);
if( tsd->sc.data[SC_SUPER_STAR] )
clif_status_load(bl,SI_SUPER_STAR,1);
}
break;
case BL_MER: // Devotion Effects
@@ -9655,6 +9671,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if (sd->sc.opt2) //Client loses these on warp.
clif_changeoption(&sd->bl);

if (battle_config.mon_trans_disable_in_gvg && map_flag_gvg2(sd->bl.m)) {
status_change_end(&sd->bl, SC_MONSTER_TRANSFORM, INVALID_TIMER);
clif_displaymessage(sd->fd, msg_txt(sd,1500)); // Transforming into monster is not allowed in Guild Wars.
}

clif_weather_check(sd);

// For automatic triggering of NPCs after map loading (so you don't need to walk 1 step first)
@@ -9670,10 +9691,8 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
// If player is dead, and is spawned (such as @refresh) send death packet. [Valaris]
if(pc_isdead(sd))
clif_clearunit_area(&sd->bl, CLR_DEAD);
else {
else
skill_usave_trigger(sd);
clif_changed_dir(&sd->bl, SELF);
}

// Trigger skill effects if you appear standing on them
if(!battle_config.pc_invincible_time)
@@ -16564,6 +16583,7 @@ int clif_autoshadowspell_list(struct map_session_data *sd) {

return 1;
}

/*===========================================
* Skill list for Four Elemental Analysis
* and Change Material skills.
@@ -920,7 +920,7 @@ void guild_retrieveitembound(int char_id,int aid,int guild_id)
for(i=0; i<g->max_member; i++){
TBL_PC *pl_sd = g->member[i].sd;
if(pl_sd && pl_sd->state.storage_flag == 2)
storage_guild_storageclose(sd);
storage_guild_storageclose(pl_sd);
}
}
intif_itembound_req(char_id,aid,guild_id);
@@ -18015,6 +18015,82 @@ BUILDIN_FUNC(getserverdef){
return 0;
}

/*==========================================
* Turns a player into a monster and grants SC attribute effect. [malufett/Hercules]
* montransform <monster name/ID>, <duration>, <sc type>, <val1>, <val2>, <val3>, <val4>;
*------------------------------------------*/
BUILDIN_FUNC(montransform) {

TBL_PC *sd;
enum sc_type type;
char msg[CHAT_SIZE_MAX];
int tick, mob_id, val1, val2, val3, val4;

if( (sd = script_rid2sd(st)) == NULL )
return 1;

if( script_isstring(st, 2) )
mob_id = mobdb_searchname(script_getstr(st, 2));
else
mob_id = mobdb_checkid(script_getnum(st, 2));

tick = script_getnum(st, 3);
type = (sc_type)script_getnum(st, 4);
val1 = val2 = val3 = val4 = 0;

if (mob_id == 0) {
if( script_isstring(st,2) )
ShowWarning("buildin_montransform: Attempted to use non-existing monster '%s'.\n", script_getstr(st, 2));
else
ShowWarning("buildin_montransform: Attempted to use non-existing monster of ID '%d'.\n", script_getnum(st, 2));
return 0;
}

if (mob_id == MOBID_EMPERIUM) {
ShowWarning("buildin_montransform: Monster 'Emperium' cannot be used.\n");
return 0;
}

if (!(type > SC_NONE && type < SC_MAX)) {
ShowWarning("buildin_montransform: Unsupported status change id %d\n", type);
return 0;
}

if (script_hasdata(st, 5))
val1 = script_getnum(st, 5);

if (script_hasdata(st, 6))
val2 = script_getnum(st, 6);

if (script_hasdata(st, 7))
val3 = script_getnum(st, 7);

if (script_hasdata(st, 8))
val4 = script_getnum(st, 8);

if (tick != 0) {
struct mob_db *monster = mob_db(mob_id);

if (battle_config.mon_trans_disable_in_gvg && map_flag_gvg2(sd->bl.m)) {
clif_displaymessage(sd->fd, msg_txt(sd,1500)); // Transforming into monster is not allowed in Guild Wars.
return 0;
}

if (sd->disguise){
clif_displaymessage(sd->fd, msg_txt(sd,1498)); // Cannot transform into monster while in disguise.
return 0;
}

sprintf(msg, msg_txt(sd,1497), monster->name); // Traaaansformation-!! %s form!!
clif_disp_overhead(&sd->bl, msg);
status_change_end(&sd->bl, SC_MONSTER_TRANSFORM, INVALID_TIMER); // Clear previous
sc_start2(NULL, &sd->bl, SC_MONSTER_TRANSFORM, 100, mob_id, type, tick);
sc_start4(NULL, &sd->bl, type, 100, val1, val2, val3, val4, tick);
}

return 0;
}

#include "../custom/script.inc"

// declarations that were supposed to be exported from npc_chat.c
@@ -18495,6 +18571,8 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(is_clientver,"ii?"),
BUILDIN_DEF(getserverdef,"i"),

BUILDIN_DEF2(montransform, "transform", "vii????"), // Monster Transform [malufett/Hercules]

#include "../custom/script_def.inc"

{NULL,NULL,NULL},
@@ -6882,6 +6882,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SC_HEAT_BARREL: case SC_HEAT_BARREL_AFTER: case SC_P_ALTER:
case SC_E_CHAIN: case SC_C_MARKER: case SC_B_TRAP:
case SC_H_MINE:
case SC_MTF_ASPD: case SC_MTF_RANGEATK: case SC_MTF_MATK:
case SC_MTF_MLEATKED: case SC_MTF_CRIDAMAGE:
#ifdef RENEWAL
case SC_EXTREMITYFIST2:
#endif
@@ -8365,6 +8367,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SC_HEAT_BARREL: case SC_HEAT_BARREL_AFTER: case SC_P_ALTER:
case SC_E_CHAIN: case SC_C_MARKER: case SC_B_TRAP:
case SC_H_MINE:
case SC_MTF_ASPD: case SC_MTF_RANGEATK: case SC_MTF_MATK:
case SC_MTF_MLEATKED: case SC_MTF_CRIDAMAGE:
#ifdef RENEWAL
case SC_EXTREMITYFIST2:
#endif

0 comments on commit 9c438ce

Please sign in to comment.