Jump to content

astralprojection

Members
  • Content Count

    333
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by astralprojection


  1. // exp share and added zeny share [Valaris]
    static int party_exp_share(struct party_data *p, struct block_list *src, unsigned int base_exp, unsigned int job_exp, int zeny)
    {
    	struct map_session_data* sd[MAX_PARTY];
    	unsigned int i, c;
    
    	nullpo_ret(p);
    	nullpo_ret(src);
    
    	// count the number of players eligible for exp sharing
    	for (i = c = 0; i < MAX_PARTY; i++) {
    		if( (sd[c] = p->data[i].sd) == NULL || sd[c]->bl.m != src->m || pc_isdead(sd[c]) || (battle_config.idle_no_share && pc_isidle(sd[c])) )
    			continue;
    		c++;
    	}
    	if (c < 1)
    		return 0;
    
    	base_exp/=c;
    	job_exp/=c;
    	zeny/=c;
    
    	if (battle_config.party_even_share_bonus_36 && c > 35) {
    		double bonus = 100 + battle_config.party_even_share_bonus_36*(c-1);
    		if (base_exp)
    			base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX);
    		if (job_exp)
    			job_exp = (unsigned int) cap_value(job_exp * bonus/100, 0, UINT_MAX);
    		if (zeny)
    			zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
    	} else
    	if (battle_config.party_even_share_bonus_30 && c > 29) {
    		double bonus = 100 + battle_config.party_even_share_bonus_30*(c-1);
    		if (base_exp)
    			base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX);
    		if (job_exp)
    			job_exp = (unsigned int) cap_value(job_exp * bonus/100, 0, UINT_MAX);
    		if (zeny)
    			zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
    	} else
    	if (battle_config.party_even_share_bonus_20 && c > 19) {
    		double bonus = 100 + battle_config.party_even_share_bonus_20*(c-1);
    		if (base_exp)
    			base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX);
    		if (job_exp)
    			job_exp = (unsigned int) cap_value(job_exp * bonus/100, 0, UINT_MAX);
    		if (zeny)
    			zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
    	} else
    	if (battle_config.party_even_share_bonus_10 && c > 9) {
    		double bonus = 100 + battle_config.party_even_share_bonus_10*(c-1);
    		if (base_exp)
    			base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX);
    		if (job_exp)
    			job_exp = (unsigned int) cap_value(job_exp * bonus/100, 0, UINT_MAX);
    		if (zeny)
    			zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
    	} else
    	if (battle_config.party_even_share_bonus && c < 6) {
    		double bonus = 100 + battle_config.party_even_share_bonus*(c-1);
    		if (base_exp)
    			base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX);
    		if (job_exp)
    			job_exp = (unsigned int) cap_value(job_exp * bonus/100, 0, UINT_MAX);
    		if (zeny)
    			zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
    	}
    
    	for (i = 0; i < c; i++) {
    		pc->gainexp(sd[i], src, base_exp, job_exp, false);
    
    		if (zeny) // zeny from mobs [Valaris]
    			pc->getzeny(sd[i],zeny,LOG_TYPE_PICKDROP_MONSTER,NULL);
    	}
    	return 0;
    }

    Hi guys i want to mod party.c (Party Share Bonus)
    Is this the correct way to do it?
    party_even_share_bonus: 30
    party_even_share_bonus_10: 40
    party_even_share_bonus_20: 50
    party_even_share_bonus_30: 60
    party_even_share_bonus_36: 70

    1 ~ 5 member = 30%
    6 ~ 10 member = 40%

    11 ~ 20 member = 50%
    21 ~ 35 member = 60%
    36 member = 70%


  2. Recent recent release was buggy including usables like fly wing that has itemskill on it. Sometimes is did not function as intended. I recommend use the prior release version.

     

    I dont know why Herc did not release like Release v2020.02.09+1 as they did it before to address critical issue.


  3. // Deleting #VARIABLE using query is NOT enough, you need to reset ONLINE players too.
    OnClock0000:
    	query_sql( "SELECT COUNT(`char_id`) FROM `char` WHERE `online` = 1 ", .@total );
    	freeloop(true);
    	while( .@count < .@total ){
    		// Reset variable to ONLINE players
    		query_sql( "SELECT `account_id`,`char_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY `char_id` LIMIT 128 OFFSET "+.@offset, .@aid,.@cid,.@name$ );
    		set .@i,0;
    		set .@size,getarraysize( .@cid );
     		while( .@i < .@size ){
     			if (isloggedin(.@aid[.@i], .@cid[.@i])) {
    				attachrid(.@aid[.@i]);
    				#VARIABLE = 0;
    			}
    			set .@count,.@count + 1;
    			set .@i,.@i + 1;
    		}
    		set .@offset,.@offset + .@size;
    		deletearray .@cid,.@size;
    		deletearray .@name$,.@size;
    	}
    	// Reset variable to OFFLINE players
    	query_sql("DELETE FROM `char_reg_num_db` WHERE `key` = '#VARIABLE'");	
    	freeloop(false);
    	announce "[ System ] All variable has been reset.  Enjoy the game!", bc_all, C_AQUA, FW_BOLD, 16;
    	end;

     


  4. Good day Hercules Community, may i ask where to find code regarding you respawn to savepoint after 2 kills at PvP maps.  I would like to remove the code as player respawn to save point after killed 2 times on PK maps.


  5. 2 hours ago, Zero Human said:

    If I relog, the aura disappears. How can I solve this?
    I've no errors or something.

    Edit: Solved, Dunno why sorry :/

    Aura set by @Dastgir as i remeber has issue when player try to @at . It dont open vending. Was this fix already?


  6. @AnnieRuru  It works great! Thank you.  I hooked it at pc->additem as I use @autoloot.  I think there is no way we can trigger on mob drop.  The plugin will trigger  
    - someone traded you.
    - use old card album if card

    - get from storage

    I was looking for trigger only if picked from mob drop but i think its impossible.


  7. Im so grateful on your plugin. I will hve a try.

     

    OnPCPickUpEvent.c: In function ‘plugin_init’:
    OnPCPickUpEvent.c:157:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_ITEMID",PICKUP_ITEMID,false);
      ^
    OnPCPickUpEvent.c:158:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_AMOUNT",PICKUP_AMOUNT,false);
      ^
    OnPCPickUpEvent.c:159:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_IDENTIFY",PICKUP_IDENTIFY,false);
      ^
    OnPCPickUpEvent.c:160:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_REFINE",PICKUP_REFINE,false);
      ^
    OnPCPickUpEvent.c:161:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_BROKEN",PICKUP_BROKEN,false);
      ^
    OnPCPickUpEvent.c:162:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_CARD1",PICKUP_CARD1,false);
      ^
    OnPCPickUpEvent.c:163:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_CARD2",PICKUP_CARD2,false);
      ^
    OnPCPickUpEvent.c:164:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_CARD3",PICKUP_CARD3,false);
      ^
    OnPCPickUpEvent.c:165:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_CARD4",PICKUP_CARD4,false);
      ^
    OnPCPickUpEvent.c:166:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_EXPIRE",PICKUP_EXPIRE,false);
      ^
    OnPCPickUpEvent.c:167:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_BOUND",PICKUP_BOUND,false);
      ^
    OnPCPickUpEvent.c:168:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_UNIQUEID",PICKUP_UNIQUEID,false);
      ^
    OnPCPickUpEvent.c:169:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_POSX",PICKUP_POSX,false);
      ^
    OnPCPickUpEvent.c:170:2: error: too few arguments to function ‘script->set_constant’
      script->set_constant("PICKUP_POSY",PICKUP_POSY,false);
      ^
    make[1]: *** [../../plugins/OnPCPickUpEvent.so] Error 1

    @AnnieRuru getting this during compile using latest Herc.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.