From 2fd138bcf99d5dae36069b715363029f07a5e057 Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 7 Mar 2006 04:15:39 +0000 Subject: - Some corrections due to the guild skill position change. - Removed file todo-for-stable as it's impossible to keep it updated :X git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5479 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ Dev/todo-for-stable.txt | 39 -------------------------------- conf-tmpl/battle/pet.conf | 2 +- src/map/battle.c | 2 +- src/map/map.h | 3 --- src/map/mob.c | 2 +- src/map/script.c | 51 ++++++++++++++++++++---------------------- src/map/skill.c | 57 ++++++++++++++++++++++++++--------------------- src/map/status.c | 3 +-- 9 files changed, 61 insertions(+), 100 deletions(-) delete mode 100644 Dev/todo-for-stable.txt diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 5888e3a9c..788e0e64a 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS 2006/03/06 + * Some fixes due to the guild-skill changing location (being moved from + 500->900 within the code) [Skotlex] * Fixed npc_event doing a map-check when the npc is not on any map. [Skotlex] * Fixed a debug message showing up on skill castend nodamage id when using diff --git a/Dev/todo-for-stable.txt b/Dev/todo-for-stable.txt deleted file mode 100644 index c95ab9337..000000000 --- a/Dev/todo-for-stable.txt +++ /dev/null @@ -1,39 +0,0 @@ -Place in this file any updates you did on trunk that should be merged into -stable. Remove it from the list once merged. - -- restricted mapflag (which restricts equipment/cards from being used in - certain maps) -- function battle_calc_return_damage which encapsulates damage return - cards/status. -- The update to the status change structure which unifies opt values in the - same structure as sc_data ones. Also includes a rewrite of - status_change_start as well as battle options for adjusting sc-def and - max-sc-def. -- Improved npc timers which enable multiple characters to be attached to a - timer, and each one will be executed with the attached player accordingly. -- irc bot system (which isn't even finished yet on trunk) -- The new implementation of NPC_POWERUP which uses SC_INKATK rather than - Explosion Spirits. -- Stat window showing the added damage of both weapons for dual-wielding - assassins. -- Deleting pet eggs from inventory after the pet data has arrived, not upon - hatching request. -- Battle option pk_level_range, allow_es_magic_player -- Cleanup of pc_useitem code -- Autocasted Teleport should now show a menu. -- Skill system update, usage of the new splash area range column in the db. - Code-wise lots of code cleanup. -- Skill SG_MIRACLE -- Gangster's Paradise behaviour update. -- Menu-based skill update to allow menu skills to be precasted. -- Cleanup of the global chat function. -- Revert the map-sql handling of the gm-list retrieval. -- Send the guild/party mini-dots on map-login. -- Updated the path-finding routines from jA -- Replace pc_break_equip for skill_break_equip -- Battle function autoskill_stacking -- The new non-stackable autospell implementation. -- Added autoequip flag to map-server item_data structure. -- Added autoequip flag check to pc_takeitem. -- Added script command 'autoequip', 'equip' and 'setbattleflag'. -- VC7.1 vcprojs updated. diff --git a/conf-tmpl/battle/pet.conf b/conf-tmpl/battle/pet.conf index 297ad6268..42196a398 100644 --- a/conf-tmpl/battle/pet.conf +++ b/conf-tmpl/battle/pet.conf @@ -93,4 +93,4 @@ pet_max_atk2: 1000 // Are pets disabled during Guild Wars? // If set to yes, pets are automatically returned to egg when entering castles during WoE times // and hatching is forbidden within as well. -pet_disable_in_gvg: yes +pet_disable_in_gvg: no diff --git a/src/map/battle.c b/src/map/battle.c index e2391a2f9..a215f3af9 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1343,7 +1343,7 @@ static struct Damage battle_calc_weapon_attack( } else { //Check for Perfect Hit if(sd && sd->perfect_hit > 0 && rand()%100 < sd->perfect_hit) flag.hit = 1; - if (sc && sc->count && sc->data[SC_FUSION].timer != -1) { + if (sc && sc->data[SC_FUSION].timer != -1) { flag.hit = 1; //SG_FUSION always hit [Komurka] flag.idef = flag.idef2 = 1; //def ignore [Komurka] } diff --git a/src/map/map.h b/src/map/map.h index 7dba6ac6e..14eca4ca5 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -350,7 +350,6 @@ struct weapon_data { short sp_drain_rate; short sp_drain_per; short sp_drain_value; - short add_damage_classid[MAX_PC_BONUS]; int add_damage_classrate[MAX_PC_BONUS]; int add_damage_class_count; @@ -514,7 +513,6 @@ struct map_session_data { int skilltarget; short skillx,skilly; short skillid,skilllv; - short skillitem,skillitemlv; short skillid_old,skilllv_old; short skillid_dance,skilllv_dance; @@ -1230,7 +1228,6 @@ int map_delblock_sub(struct block_list *, int); #define map_addblock(bl) map_addblock_sub(bl,1) #define map_delblock(bl) map_delblock_sub(bl,1) int map_moveblock(struct block_list *, int, int, unsigned int); - int map_foreachinrange(int (*)(struct block_list*,va_list),struct block_list *,int,int,...); int map_foreachinarea(int (*)(struct block_list*,va_list),int,int,int,int,int,int,...); // -- moonsoul (added map_foreachincell) diff --git a/src/map/mob.c b/src/map/mob.c index 700b00e7f..183e063ff 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3061,7 +3061,7 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type) status_change_end(&md->bl, SC_TRICKDEAD, -1); if(md->sc.data[SC_BLADESTOP].timer!=-1) status_change_end(&md->bl,SC_BLADESTOP,-1); - if(md->sc.data && md->sc.data[SC_RUN].timer!=-1) + if(md->sc.data[SC_RUN].timer!=-1) status_change_end(&md->bl,SC_RUN,-1); if(md->sc.data[SC_DANCING].timer!=-1) skill_stop_dancing(&md->bl); diff --git a/src/map/script.c b/src/map/script.c index b0bc77171..b615a935c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4370,33 +4370,30 @@ int buildin_strcharinfo(struct script_state *st) return 0; } num=conv_num(st,& (st->stack->stack_data[st->start+2])); - if(sd){ - switch(num){ - case 0: - buf=(char *)aCallocA(NAME_LENGTH,sizeof(char)); - memcpy(buf, sd->status.name, NAME_LENGTH-1); + switch(num){ + case 0: + buf=(char *)aCallocA(NAME_LENGTH,sizeof(char)); + memcpy(buf, sd->status.name, NAME_LENGTH-1); + push_str(st->stack,C_STR,(unsigned char *) buf); + break; + case 1: + buf=buildin_getpartyname_sub(sd->status.party_id); + if(buf!=0) push_str(st->stack,C_STR,(unsigned char *) buf); - break; - case 1: - buf=buildin_getpartyname_sub(sd->status.party_id); - if(buf!=0) - push_str(st->stack,C_STR,(unsigned char *) buf); - else - push_str(st->stack,C_CONSTSTR,(unsigned char *) ""); - break; - case 2: - buf=buildin_getguildname_sub(sd->status.guild_id); - if(buf != NULL) - push_str(st->stack,C_STR,(unsigned char *) buf); - else - push_str(st->stack,C_CONSTSTR,(unsigned char *) ""); - break; - default: - ShowWarning("buildin_strcharinfo: unknown parameter."); - break; - } - } else { - push_str(st->stack,C_CONSTSTR,(unsigned char *) ""); + else + push_str(st->stack,C_CONSTSTR,(unsigned char *) ""); + break; + case 2: + buf=buildin_getguildname_sub(sd->status.guild_id); + if(buf != NULL) + push_str(st->stack,C_STR,(unsigned char *) buf); + else + push_str(st->stack,C_CONSTSTR,(unsigned char *) ""); + break; + default: + ShowWarning("buildin_strcharinfo: unknown parameter."); + push_str(st->stack,C_CONSTSTR,(unsigned char *) ""); + break; } return 0; @@ -9058,7 +9055,7 @@ int buildin_summon(struct script_state *st) md->master_id=sd->bl.id; md->special_state.ai=1; md->mode=mob_db(md->class_)->mode|0x04; - md->deletetimer=add_timer(tick+(timeout<=0?timeout*1000:60000),mob_timer_delete,id,0); + md->deletetimer=add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,id,0); clif_misceffect2(&md->bl,344); } clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick); diff --git a/src/map/skill.c b/src/map/skill.c index 9061078b8..38c54dd79 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -597,6 +597,12 @@ int skill_get_range( int id , int lv ){ skill_get(skill_db[id].range[lv-1], id, int skill_get_splash( int id , int lv ){ skill_chk (id, lv); return (skill_db[id].splash[lv-1]>=0?skill_db[id].splash[lv-1]:AREA_SIZE); } int skill_get_hp( int id ,int lv ){ skill_get (skill_db[id].hp[lv-1], id, lv); } int skill_get_sp( int id ,int lv ){ skill_get (skill_db[id].sp[lv-1], id, lv); } +int skill_get_hp_rate(int id, int lv ){ skill_get (skill_db[id].hp_rate[lv-1], id, lv); } +int skill_get_sp_rate(int id, int lv ){ skill_get (skill_db[id].sp_rate[lv-1], id, lv); } +int skill_get_state(int id) { skill_get (skill_db[id].state, id, 1); } +int skill_get_spiritball(int id, int lv) { skill_get (skill_db[id].spiritball[lv-1], id, lv); } +int skill_get_itemid(int id, int idx) { skill_get (skill_db[id].itemid[idx], id, 1); } +int skill_get_itemqty(int id, int idx) { skill_get (skill_db[id].amount[idx], id, 1); } int skill_get_zeny( int id ,int lv ){ skill_get (skill_db[id].zeny[lv-1], id, lv); } int skill_get_num( int id ,int lv ){ skill_get (skill_db[id].num[lv-1], id, lv); } int skill_get_cast( int id ,int lv ){ skill_get (skill_db[id].cast[lv-1], id, lv); } @@ -721,14 +727,14 @@ int skillnotok(int skillid, struct map_session_data *sd) //return 1; // I think it was meant to be "no skills allowed when not a valid sd" - if (!(skillid >= 10000 && skillid < 10015)) + if (!(skillid >= GD_SKILLRANGEMIN && skillid <= GD_SKILLRANGEMAX)) if ((skillid > MAX_SKILL) || (skillid < 0)) return 1; { int i = skillid; - if (i >= 10000 && i < 10015) - i -= 9500; + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; if (sd->blockskill[i] > 0) return 1; } @@ -7539,21 +7545,20 @@ int skill_check_condition(struct map_session_data *sd,int type) lv = sd->skilllv; if (lv <= 0) return 0; // for the guild skills [celest] - if (skill >= 10000 && skill < 10015) skill-= 9500; hp = skill_get_hp(skill, lv); /* ?チ費HP */ sp = skill_get_sp(skill, lv); /* ?チ費SP */ if((sd->skillid_old == BD_ENCORE) && skill == sd->skillid_dance) sp=sp/2; //アンコ?ル時はSP?チ費が半分 - hp_rate = (lv <= 0)? 0:skill_db[skill].hp_rate[lv-1]; - sp_rate = (lv <= 0)? 0:skill_db[skill].sp_rate[lv-1]; + hp_rate = skill_get_hp_rate(skill, lv); + sp_rate = skill_get_sp_rate(skill, lv); zeny = skill_get_zeny(skill,lv); - weapon = skill_db[skill].weapon; - state = skill_db[skill].state; - spiritball = (lv <= 0)? 0:skill_db[skill].spiritball[lv-1]; + weapon = skill_get_weapontype(skill); + state = skill_get_state(skill); + spiritball = skill_get_spiritball(skill,lv); mhp = skill_get_mhp(skill, lv); /* ?チ費HP */ for(i = 0; i < 10; i++) { - itemid[i] = skill_db[skill].itemid[i]; - amount[i] = skill_db[skill].amount[i]; + itemid[i] = skill_get_itemid(skill, i); + amount[i] = skill_get_itemqty(skill, i); } if(mhp > 0) hp += (sd->status.max_hp * mhp)/100; @@ -11077,9 +11082,9 @@ int skill_readdb(void) continue; i=atoi(split[0]); - if (i>=10000 && i<10015) // for guild skills [Celest] - i -= 9500; - else if(i<=0 || i>MAX_SKILL_DB) + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; + if(i<=0 || i>MAX_SKILL_DB) continue; skill_split_atoi(split[1],skill_db[i].hp); @@ -11168,9 +11173,9 @@ int skill_readdb(void) continue; } i=atoi(split[0]); - if (i>=10000 && i<10015) // for guild skills [Celest] - i -= 9500; - else if(i<=0 || i>MAX_SKILL_DB) + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; + if(i<=0 || i>MAX_SKILL_DB) continue; skill_split_atoi(split[1],skill_db[i].cast); @@ -11200,9 +11205,9 @@ int skill_readdb(void) continue; i=atoi(split[0]); - if (i>=10000 && i<10015) // for guild skills [Celest] - i -= 9500; - else if(i<=0 || i>MAX_SKILL_DB) + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; + if(i<=0 || i>MAX_SKILL_DB) continue; skill_db[i].unit_id[0] = strtol(split[1],NULL,16); skill_db[i].unit_id[1] = strtol(split[2],NULL,16); @@ -11359,9 +11364,9 @@ int skill_readdb(void) if(split[0]==0) //fixed by Lupus continue; i=atoi(split[0]); - if (i>=10000 && i<10015) // for guild skills [Celest] - i -= 9500; - else if(i<=0 || i>MAX_SKILL_DB) + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; + if(i<=0 || i>MAX_SKILL_DB) continue; skill_split_atoi(split[1],skill_db[i].castnodex); @@ -11388,9 +11393,9 @@ int skill_readdb(void) if(split[0]==0) //fixed by Lupus continue; i=atoi(split[0]); - if (i>=10000 && i<10015) // for guild skills [Celest] - i -= 9500; - else if(i<=0 || i>MAX_SKILL_DB) + if (i >= GD_SKILLBASE) + i = GD_SKILLRANGEMIN + i - GD_SKILLBASE; + if(i<=0 || i>MAX_SKILL_DB) continue; skill_db[i].nocast=atoi(split[1]); k++; diff --git a/src/map/status.c b/src/map/status.c index 831b18eb5..3e0c844f5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3565,7 +3565,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break; } - //Check for BOSS resistnces + //Check for BOSS resistances if(mode & MD_BOSS && !(flag&1)) { if (type>=SC_COMMON_MIN && type <= SC_COMMON_MAX) return 0; @@ -5541,7 +5541,6 @@ int status_change_timer_sub(struct block_list *bl, va_list ap ) { if(tsd) //Only damage SP [Skotlex] - // case SG_SUN_WARM: pc_damage_sp(tsd, 60, 0); else { //Otherwise, Knockback attack. if(sd && pc_damage_sp(sd, 2, 0) <= 0) -- cgit v1.2.3-70-g09d2