Jump to content

pan

Community Contributors
  • Content Count

    355
  • Joined

  • Last visited

  • Days Won

    13

Posts posted by pan


  1.  

     

    No you don't, if you add that SC_FREEZE will not be started in players that have luk >= 240

    What if I want to add : 220 Luk = 3secs Freeze. it will be : 

     

              // Players that have luk above or equal 260 are immune to Freeze

    if( type == SC_FREEZE && sd->battle_status.luk >= 260 )

    return 0;

    // Players that have luk above or equal 240 have freeze timer reduced to 2s

    if( type == SC_FREEZE && sd->battle_status.luk >= 240 && tick > 2000 )

    tick = 2000; // is in ms

                  return 0;

              // Players that have luk above or equal 220 have freeze timer reduced to 3s

    if( type == SC_FREEZE && sd->battle_status.luk >= 220 && tick > 3000 )

    tick = 3000; // is in ms

     

    Is this correct? only the last one will not have return 0;

     

     

    No it's not correct, it should be something like:
    			// Players that have luk above or equal 260 are immune to Freeze			if( type == SC_FREEZE && sd->battle_status.luk >= 260 )				return 0;			// Players that have luk above or equal 240 have freeze timer reduced to 2s			if( type == SC_FREEZE && sd->battle_status.luk >= 240 && tick > 2000 )				tick = 2000; // is in ms			if( type == SC_FREEZE && sd->battle_status.luk >= 220 && sd->battle_status.luk < 240 && tick > 3000 )				tick = 3000;
    If you return, the rest of this function won't be read, then it won't activate SC_FREEZE. Note that there are two different checks regarding luk in the third condition

  2. Hello, lately I was reading Hercules' source-code and I've noticed that there are many functions that are defined as 'int' types but are constant, they're returning only one value. Look for instance at pc_bonus it returns 0 in all possible inputs...

    I guess that functions like this should return whether they were successful or not, otherwise there's no way to handle exceptions like if there was an incorrect input. For instance pc_bonus should be defined as 'bool' instead of 'int' and return whether it was successful or not, I'm sure that there're many functions that are defined "incorrectly" as well.

     

    Hope I've helped,

    Pan.


  3. I haven't tested those changes in-game, but they should work fine c: otherwise just post and I'll correct any mistakes, ok?

    Open src/map/status.c and search for:

    		case SC_FREEZE:			//Undead are immune to Freeze/Stone			if (undead_flag && !(flag&1))				return 0;
    Add below:
    			// Players that have luk above or equal 260 are immune to Freeze			if( type == SC_FREEZE && sd->battle_status.luk >= 260 )				return 0;			// Players that have luk above or equal 240 have freeze timer reduced to 2s			if( type == SC_FREEZE && sd->battle_status.luk >= 240 && tick > 2000 )				tick = 2000; // is in ms
    Save and rebuild.

     

    Happy new year


  4.  

     

    Which skills are you trying to use? Only the ones that are in this

    range: 2458 to 2460 are working without stones, only skills that summon

    :x

     

    That's exactly what I am attempting. By the way, the IDs for the summoning skills are 2457~2460, so maybe that' incorrect? Still, at least 3 out of 4 of the skills should work, yet they don't.

     

    *edit* Mechanic Fuel worked. Thank you so much.

     

     

    2457,0,6,4,3,0x1,0,3,1,yes,0,0,0,none,0,	SO_SUMMON_AGNI,Summon Fire Spirit Agni2458,0,6,4,1,0x1,0,3,1,yes,0,0,0,none,0,	SO_SUMMON_AQUA,Summon Water Spirit Aqua2459,0,6,4,4,0x1,0,3,1,yes,0,0,0,none,0,	SO_SUMMON_VENTUS,Summon Wind Spirit Ventus2460,0,6,4,2,0x1,0,3,1,yes,0,0,0,none,0,	SO_SUMMON_TERA,Summon Earth Spirit Tera
    Oh, sorry, they're indeed wrong, I forgot to add Summon Fire Spirit Agni in the list:
    		// 990 to 997 sorcerer stones only works when using summon skills		if( (req.itemid[i] >= 990 && req.itemid[i] <= 997) && sd->special_state.no_elementalstones			&& (skill_id >= SO_SUMMON_AQUA && skill_id <= SO_SUMMON_TERA) )			req.itemid[i] = req.amount[i] = 0;
    to:
    		// 990 to 997 sorcerer stones only works when using summon skills		if( (req.itemid[i] >= 990 && req.itemid[i] <= 997) && sd->special_state.no_elementalstones			&& (skill_id >= SO_SUMMON_AGNI && skill_id <= SO_SUMMON_TERA) )			req.itemid[i] = req.amount[i] = 0;
    Build and see if this works if it does I'll update my other post to add all this changes, ok?

     

    Regards


  5.  

     

    Well I did it:

    @balarm <color> <type> <file name> <message>

    type

    0 - Global message

    1 - Local message

    file name

    It's a file that is inside your grfwavfile.wav

    color

    Uses the same configuration as '@kamic'

    Sourcefile is at:
    http://pastebin.com/TFS0GCDs
    Regards

     

     

     

    Is there a .wav file for this?

     

     

    There isn't, any file that is in your wav folder will work.

    If you're going to use the command download the new version: http://herc.ws/board/files/file/88-broadcast-alarm/


  6. Which skills are you trying to use? Only the ones that are in this range: 2458 to 2460 are working without stones, only skills that summon :x

    Yes it is possible just open srcmapskill.c and search for:

    		// 6120 to 6123 Paint related items		if( (req.itemid[i] >= 6120 && req.itemid[i] <= 6123) && sd->special_state.no_paintcans )			req.itemid[i] = req.amount[i] = 0;
    Add below:
    		// 6146 Magic fuel		if( req.itemid[i] == 6146 && sd->special_state.no_fuel )			req.itemid[i] = req.amount[i] = 0;
    Now open src/map/pc.h and search for:
    		unsigned int no_paintcans : 1;
    Add below:
    		unsigned int no_fuel : 1;
    Now open src/map/map.h and search for:
    SP_NO_CATALYSTSTONES, SP_NO_ELEMENTALSTONES,SP_NO_PAINTCANS, // 2059-2061 [pan]
    Replace it with:
    	SP_NO_CATALYSTSTONES, SP_NO_ELEMENTALSTONES,SP_NO_PAINTCANS,SP_NO_FUEL, // 2059-2062 [pan]
    Now open src/map/pc.c and search for:
    		case SP_NO_PAINTCANS:			if(sd->state.lr_flag != 2)				sd->special_state.no_paintcans = 1;			break;
    Add below:
    		case SP_NO_FUEL:			if(sd->state.lr_flag != 2)				sd->special_state.no_fuel = 1;			break;
    Search for:
    		case SP_NO_PAINTCANS:	 val = sd->special_state.no_paintcans?1:0; break;
    Add below:
    		case SP_NO_FUEL:		 val = sd->special_state.no_fuel?1:0; break;
    Now open const.txt and search for:
    bNoPaintCans		2061
    Add below:
    bNoFuel		2062
    Here's the new patch: http://pastebin.com/GpKYdkU0

  7. You could code a new mapflag that works just like GvG, but if traps change their look only in castle maps, independing on which mapflag is active, then the client is parsing them this way only in this type of map, so you could change the type of maps that all castles are, client and server-side and see if that works, but I'm not so sure... As far as I'm aware of there's not much that can be done server-side to "fix" this issue :x Sometime ago there was a client edit called XRay in that type of client you could even add new Unit types, so if you can find a XRay that works properly with your server and then edit it c:


  8. Well, it depends on which item is required to use the skill, I didn't add "face paint" :x I don't know why this error is returning, maybe you're calling the script function bonus with a 'bonus' that isn't on dbconst.txt? Well I added all paint related items to the diff and to my last post c:


  9. My guess is that the way that the cursor changes is client-related, the server just sends packets that identify an unit as a trap, then your client chooses on how it'll be displayed. You could change which kind of unit is identified as a trap and change sprites in your grf file, but you'd have to replace an existing unit type and the client would handle it the same way it was handled before your "change"

    @skill.h/// The client view ids for land skills.enum {	UNT_SAFETYWALL = 0x7e,[...]	UNT_HIDDEN_TRAP, //TODO	UNT_TRAP, //TODO	UNT_HIDDEN_WARP_NPC, //TODO	UNT_USED_TRAPS,
    @clif.c//Sends a change-base-look packet required for traps as they are triggered.void clif_changetraplook(struct block_list *bl,int val){	unsigned char buf[32];#if PACKETVER < 4	WBUFW(buf,0)=0xc3;	WBUFL(buf,2)=bl->id;	WBUFB(buf,6)=LOOK_BASE;	WBUFB(buf,7)=val;	clif->send(buf,packet_len(0xc3),bl,AREA);#else	WBUFW(buf,0)=0x1d7;	WBUFL(buf,2)=bl->id;	WBUFB(buf,6)=LOOK_BASE;	WBUFW(buf,7)=val;	WBUFW(buf,9)=0;	clif->send(buf,packet_len(0x1d7),bl,AREA);#endif}
    Happy holidays

  10. It looks like it's correct:

    Job_Name: { // Job names as in src/map/pc.c (they are hardcoded at the moment so if you want to add a new job you should add it there)	inherit: ( "Other_Job_Name" ); // Base job from which this job will inherit its skill tree. NV_TRICKDEAD inheritance is skipped for non-novices from the source 	skills: { // SKILL_NAMEs come from the Name (16th column) value in db/re/skill_db.txt 		SKILL_NAME1: Max_Level // Use this for skills that don't have other skill prerequisite; Max_Level is a numeric value that should match your client side files 		SKILL_NAME2: { // Use this for skills which have other skills as prerequisites 			MaxLevel: Max_Level // Max_Level is a numeric value that should match your client side files 			SKILL_NAME_PREREQUISITE: Level_Prerequisite // The prerequisite skill and min level for having this skill available. Should also match your client side files 			SKILL_NAME_PREREQUISITE2: Level_Prerequisite2 // You can add as many prerequisite skills as you want. Minimum of 1 if you add a skill this way	}}
    (From dbreskill_tree.conf)

  11. I forgot to add in my last post, open src/map/pc.c and search for:

            case SP_NO_GEMSTONE:            if(sd->state.lr_flag != 2)                sd->special_state.no_gemstone = 1;            break;
    Add below it:
            case SP_NO_CATALYSTSTONES:            if(sd->state.lr_flag != 2)                sd->special_state.no_catalyststones = 1;            break;        case SP_NO_ELEMENTALSTONES:            if(sd->state.lr_flag != 2)                sd->special_state.no_elementalstones = 1;            break;        case SP_NO_PAINTCANS:            if(sd->state.lr_flag != 2)                sd->special_state.no_paintcans = 1;            break;
    Now it should be working just fine c: I also created a patch this time:

    http://pastebin.com/Vuu7r9DE

    I'll edit my other post as well


  12. Oh sorry, I got that totally wrong those formulae that are in my other are the attack formulae :x to change the skill range just modify your skill_db:

     

    2328,0,6,4,-1,0x2,1:2:3:4:5,5,1,no,0,0,0,weapon,0,	SR_EARTHSHAKER,Earth Shaker

    1:2:3:4:5 to whichever value you desire

     

    Sorry for my other answer :x


  13. The mod that's in the topic that you posted doesn't work at all :x So I've made some changes to fit what you want...

    Open src/map/atcommand.c and search for:
        if (map->list[m_id].flag.nomemo)        strcat(atcmd_output, msg_txt(1064)); // NoMemo |
    add below:
        if (map->list[m_id].flag.asuraabsorb)        strcat(atcmd_output, "AsuraAbsorb |");
    Search for:
    CHECKFLAG(nocashshop);
    Add below:
    CHECKFLAG(asuraabsorb);
    Search for:
    SETFLAG(nocashshop);
    Add below:
    SETFLAG(asuraabsorb);
    Search for:
    clif->message(sd->fd,"guildlock, src4instance, notomb, nocashshop");
    Replace it with:
    clif->message(sd->fd,"guildlock, src4instance, notomb, nocashshop, asuraabsorb");
    Now open src/map/map.c and search for:
        } else if (!strcmpi(flag,"nocashshop")) {        if( state && map->list[m].flag.nocashshop )            ;/* nothing to do */        else {            if( state )                map_zone_mf_cache_add(m,"nocashshoptoff");            else if( map->list[m].flag.nocashshop )                map_zone_mf_cache_add(m,"nocashshop");        }    }
    Add below:
    else if( !strcmpi(flag,"asuraabsorb")) {        if( state && map->list[m].flag.asuraabsorb )            ; /* nothing to do */        else {            if( state )                map_zone_mf_cache_add(m,"asuraabsorbtoff");            else if( map->list[m].flag.asuraabsorb )                map_zone_mf_cache_add(m,"asuraabsorb");        }    }
    Now open src/map/map.h and find:
            unsigned nocashshop : 1;
    Add below it:
            unsigned asuraabsorb : 1;
    Now open src/map/npc.c and search for:
        } else if ( !strcmpi(w3,"nocashshop") ) {        map->list[m].flag.nocashshop = (state) ? 1 : 0;    } else        ShowError("npc_parse_mapflag: unrecognized mapflag '%s' in file '%s', line '%d'.n", w3, filepath, strline(buffer,start-buffer));
    Replace it with:
        } else if ( !strcmpi(w3,"nocashshop") ) {        map->list[m].flag.nocashshop = (state) ? 1 : 0;    } else if( !strcmpi(w3, "asuraabsorb") ) {        map->list[m].flag.asuraabsorb = state;    } else        ShowError("npc_parse_mapflag: unrecognized mapflag '%s' in file '%s', line '%d'.n", w3, filepath, strline(buffer,start-buffer));
    Open src/map/script.h and search for:
    MF_NOCASHSHOP
    Replace it with:
    	MF_NOCASHSHOP,	MF_ASURAABSORB
     
    Now open src/map/script.c and search for:
                case MF_NOCASHSHOP:         script_pushint(st,map->list[m].flag.nocashshop); break;
    Add below:
                case MF_ASURAABSORB:        script_pushint(st,map->list[m].flag.asuraabsorb); break;
    Search for:
                case MF_NOCASHSHOP:         map->list[m].flag.nocashshop = 1; break;
    Add below:
                case MF_ASURAABSORB:        map->list[m].flag.asuraabsorb = 1; break;
    Search for:
                case MF_NOCASHSHOP:         map->list[m].flag.nocashshop = 0; break;
    Add below:
                case MF_ASURAABSORB:        map->list[m].flag.asuraabsorb = 0; break;
    And finally open src/map/skill.c and search for:
            case NJ_ISSEN:        case MO_EXTREMITYFIST:            {                short x, y, i = 2; // Move 2 cells for Issen(from target)                struct block_list *mbl = bl;                short dir = 0;
    Add below:
                    struct skill_condition req = skill->get_requirement(sd,skill_id,skill_lv);                if( req.spiritball > sd->spiritball && map->list[src->m].flag.asuraabsorb )                {                    clif->skill_fail(sd, skill_id, 0, 0);                    break;                }

     

     

    Built successfully and tested in-game c: If you want any map to have asuraabsorb just set the mapflag and it'll work.

     

    Happy holidays


  14. File Name: Broadcast Alarm

    File Submitter: pan

    File Submitted: 25 Dec 2013

    File Category: Plugins

     

    @balarm <color> <type> <file name> <message>

    Type

    0 - Global message

    1 - Local message

     

    File name

    It's a file that is inside your grfwavfile.wav

    WARNING! If nonexistent file is put all hexeds that receive this broadcast will crash!

     

    Color

    Uses the same configuration as '@kamic'

     

    Source-code:

    http://pastebin.com/TFS0GCDs v1.0

    http://pastebin.com/idsFvmhJ v1.1

    For more information see: http://herc.ws/board/topic/3525-broadcast-with-sound-alarm/

     

    Click here to download this file


  15. Oh sorry :x here are the changes that you need to do:

    Open src/map/pc.c and search for:

    case SP_NO_GEMSTONE:     val = sd->special_state.no_gemstone?1:0; break;
    Add below it:
    		case SP_NO_CATALYSTSTONES: val = sd->special_state.no_catalyststones?1:0; break;		case SP_NO_ELEMENTALSTONES:val = sd->special_state.no_elementalstones?1:0; break;		case SP_NO_PAINTCANS:	 val = sd->special_state.no_paintcans?1:0; break;		case SP_NO_FUEL:		 val = sd->special_state.no_fuel?1:0; break;
    Search for:
            case SP_NO_GEMSTONE:            if(sd->state.lr_flag != 2)                sd->special_state.no_gemstone = 1;            break;
    Add below it:
    		case SP_NO_CATALYSTSTONES:			if(sd->state.lr_flag != 2)				sd->special_state.no_catalyststones = 1;			break;		case SP_NO_ELEMENTALSTONES:			if(sd->state.lr_flag != 2)				sd->special_state.no_elementalstones = 1;			break;		case SP_NO_PAINTCANS:			if(sd->state.lr_flag != 2)				sd->special_state.no_paintcans = 1;			break;		case SP_NO_FUEL:			if(sd->state.lr_flag != 2)				sd->special_state.no_fuel = 1;			break;
    Now open src/map/map.h and search for:
    SP_SKILL_USE_SP,SP_MAGIC_ATK_ELE, SP_ADD_FIXEDCAST, SP_ADD_VARIABLECAST,  //2055-2058
    Add below it:
    	SP_NO_CATALYSTSTONES, SP_NO_ELEMENTALSTONES,SP_NO_PAINTCANS,SP_NO_FUEL, // 2059-2062 [pan]
    Open src/map/pc.h and search for:
    unsigned int bonus_coma : 1;
    Add below:
    		unsigned int no_catalyststones : 1;		unsigned int no_elementalstones : 1;		unsigned int no_paintcans : 1;		unsigned int no_fuel : 1;
    Open src/map/skill.c, search for:
    		if( itemid_isgemstone(req.itemid[i]) && skill_id != HW_GANBANTEIN )		{			if( sd->special_state.no_gemstone )			{	// All gem skills except Hocus Pocus and Ganbantein can cast for free with Mistress card -helvetica				if( skill_id != SA_ABRACADABRA )					req.itemid[i] = req.amount[i] = 0;				else if( --req.amount[i] < 1 )					req.amount[i] = 1; // Hocus Pocus always use at least 1 gem			}			if(sc && sc->data[SC_INTOABYSS])			{				if( skill_id != SA_ABRACADABRA )					req.itemid[i] = req.amount[i] = 0;				else if( --req.amount[i] < 1 )					req.amount[i] = 1; // Hocus Pocus always use at least 1 gem			}		}
    Add below it:
    		// 7521 to 7524 ninja stones		if( (req.itemid[i] >= 7521 && req.itemid[i] <= 7524) && sd->special_state.no_catalyststones	)			req.itemid[i] = req.amount[i] = 0;		// 6120 to 6123 Paint related items		if( (req.itemid[i] >= 6120 && req.itemid[i] <= 6123) && sd->special_state.no_paintcans )			req.itemid[i] = req.amount[i] = 0;		// 6146 Magic fuel		if( req.itemid[i] == 6146 && sd->special_state.no_fuel )			req.itemid[i] = req.amount[i] = 0;
    Now search for:
    		case SO_EARTH_INSIGNIA:			req.itemid[skill_lv-1] = skill->db[idx].itemid[skill_lv-1];			req.amount[skill_lv-1] = skill->db[idx].amount[skill_lv-1];			break;	}
    Add below:
    	// 990 to 997 sorcerer stones only works when using summon skills	if( (req.itemid[skill_lv-1] >= 990 && req.itemid[skill_lv-1] <= 997) && sd->special_state.no_elementalstones		&& (skill_id >= SO_SUMMON_AGNI && skill_id <= SO_SUMMON_TERA) )		req.itemid[skill_lv-1] = req.amount[skill_lv-1] = 0;
    Now open /db/const.txt and search for:
    bVariableCast	2058
    Add below:
    bNoCatalystStones	2059bNoElementalStones	2060bNoPaintCans		2061bNoFuel		2062
    Save all files and rebuild your map-server... Just add these codes to your mistress card:
    bonus bNoCatalystStones,0; bonus bNoElementalStones,0; bonus bNoPaintCans,0; bonus bNoFuel,0;
    It's done c: If you're having any trouble just post, ok?

     

    Happy holidays

     

    EDIT:

    I corrected everything in this post, everything is worked and has been tested in-game.

    Diff:

    http://pastebin.com/vmxRZR8P


  16. Well there's a way to reset hatred:

    ACMD(hatereset){	pc->resethate(sd);	clif->message(fd, "Reset 'hate' mobs, kicking...");	clif->GM_kick(NULL, sd);	return true;}
    Although I'm not sure if this is going to work...
×
×
  • Create New...

Important Information

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