soroz
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Posts posted by soroz
-
-
Thank you poporing. It works
-
I found something in battle_calc_base_damage funciton in file battle.c
static int battle_calc_base_damage(struct status_data *status, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, struct map_session_data *sd, int flag)and this snippet
//Weapon Damage calculationif (!(flag&1))damage = (atkmax>atkmin? rand()%(atkmax-atkmin):0)+atkmin;elsedamage = atkmax;This snippet is seperate a critical hit and non-critical hit damage and i want to modify it, when assasin class (assasin, assasin cross, baby assasin) make critical damage. It will be multiple with 1.5 or 2.But i didn't know how to get the character class to check if condition is met. Im not sure that map_session_data contains any properties that refer to the class of damage dealer (Maybe sd->class_ ??) and if what i think is correct how do i compare to the 3 class that i mention above.Please help, and sorry for my english mistake i am not a native speaker.Thaks
How to modify the damage of assasin class when its get critical?
in Source Support
Posted
In additional, this snippet
if((sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN)
will cause a fatal error an.d bring the map server down because when critical event cause by a monster a sd pointer will given a null and server will be crashed with pagefault
to prevent this we have to check that if sd is null or not first
if(sd && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN)
and this line should works well