- Cleaned up Summon Slave mob skill to only summon number of missing mobs to complete the skill level (that is, SS level 5 will always bring the total count of slaves to 5, never above)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5138 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
cf99ac6795
commit
3e1a4e221c
@ -5,6 +5,9 @@ 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
|
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
|
||||||
|
|
||||||
2006/01/31
|
2006/01/31
|
||||||
|
* Cleaned up Summon Slave mob skill to only summon number of missing mobs
|
||||||
|
to complete the skill level (that is, SS level 5 will always bring the
|
||||||
|
total count of slaves to 5, never above). [Skotlex]
|
||||||
* Fixed being able to Encore skills you no longer have in your tree.
|
* Fixed being able to Encore skills you no longer have in your tree.
|
||||||
[Skotlex]
|
[Skotlex]
|
||||||
* Added no HP regen while Bleeding, -25% ATK and ASPD penalties as well.
|
* Added no HP regen while Bleeding, -25% ATK and ASPD penalties as well.
|
||||||
|
@ -3067,17 +3067,13 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type)
|
|||||||
*/
|
*/
|
||||||
int mob_countslave_sub(struct block_list *bl,va_list ap)
|
int mob_countslave_sub(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
int id,*c;
|
int id;
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
id=va_arg(ap,int);
|
id=va_arg(ap,int);
|
||||||
|
|
||||||
c=va_arg(ap,int *);
|
|
||||||
md = (struct mob_data *)bl;
|
md = (struct mob_data *)bl;
|
||||||
|
if( md->master_id==id )
|
||||||
if( md->master_id==id ) {
|
|
||||||
(*c)++;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3087,9 +3083,7 @@ int mob_countslave_sub(struct block_list *bl,va_list ap)
|
|||||||
*/
|
*/
|
||||||
int mob_countslave(struct block_list *bl)
|
int mob_countslave(struct block_list *bl)
|
||||||
{
|
{
|
||||||
int c=0;
|
return map_foreachinmap(mob_countslave_sub, bl->m, BL_MOB,bl->id);
|
||||||
map_foreachinmap(mob_countslave_sub, bl->m, BL_MOB,bl->id,&c);
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Summons amount slaves contained in the value[5] array using round-robin. [adapted by Skotlex]
|
* Summons amount slaves contained in the value[5] array using round-robin. [adapted by Skotlex]
|
||||||
@ -3098,7 +3092,7 @@ int mob_countslave(struct block_list *bl)
|
|||||||
int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
|
int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
int bx,by,m,count = 0,class_,k;
|
int bx,by,m,count = 0,class_,k=0;
|
||||||
|
|
||||||
nullpo_retr(0, md2);
|
nullpo_retr(0, md2);
|
||||||
nullpo_retr(0, value);
|
nullpo_retr(0, value);
|
||||||
@ -3112,8 +3106,11 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
|
|||||||
|
|
||||||
while(count < 5 && mobdb_checkid(value[count])) count++;
|
while(count < 5 && mobdb_checkid(value[count])) count++;
|
||||||
if(count < 1) return 0;
|
if(count < 1) return 0;
|
||||||
|
if (amount > 0 && amount < count) { //Do not start on 0, pick some random sub subset [Skotlex]
|
||||||
for(k=0;k<amount;k++) {
|
k = rand()%count;
|
||||||
|
amount+=k; //Increase final value by same amount to preserve total number to summon.
|
||||||
|
}
|
||||||
|
for(;k<amount;k++) {
|
||||||
int x=0,y=0,i=0;
|
int x=0,y=0,i=0;
|
||||||
class_ = value[k%count]; //Summon slaves in round-robin fashion. [Skotlex]
|
class_ = value[k%count]; //Summon slaves in round-robin fashion. [Skotlex]
|
||||||
|
|
||||||
|
@ -5128,6 +5128,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NPC_SUMMONSLAVE: /* Žè‰º?¢Š« */
|
case NPC_SUMMONSLAVE: /* Žè‰º?¢Š« */
|
||||||
|
if (md) //Only summon remaining slaves
|
||||||
|
skilllv = skilllv - mob_countslave(&md->bl);
|
||||||
case NPC_SUMMONMONSTER: /* MOB?¢Š« */
|
case NPC_SUMMONMONSTER: /* MOB?¢Š« */
|
||||||
if(md)
|
if(md)
|
||||||
mob_summonslave(md,md->db->skill[md->skillidx].val,skilllv,skillid);
|
mob_summonslave(md,md->db->skill[md->skillidx].val,skilllv,skillid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user