Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Kurofly

  1. item_group_db

    import: db/pre-re/item_hatbox.txt

     

    Shouldn't that be 'import: db/re/item_hatbox.txt' instead ? Since the items starting from id 20k are all renewals I guess you placed your files in the renewal folder.

     

    That might be why your client isn't finding the items you're looking for.

  2. You should keep a trace of the party id when warping them, this way you can use the 'OnPCDieEvent' label to know if the player who just died was in that party (use getcharid(1) to retrieve the party id since the player is attached to the script on death).

    If the player is indeed in the party doing the event, you jut have to warp the entire party out with the 'warpparty' script command.

     

    For the delay part, I'll need a bit more infos:

    Do you want to make the party unable to join the event for 5 minutes by forbidding the party id? (which can easily be useless if the players just change their party)

    Or do you want to make each player unable to join for 5 minutes? (which will make any party which has an unauthorized player unable to do the event for the remaining time)

    Or maybe a mix of those two, like a party can join if the total of each player restrictcion time doesn't go over a certain amount?

  3. Give us the lines you wrote in the files you edited, we'll try it and tell you if something's wrong in our servers and try to solve the problems if we have some.

     

    Also I don't really get what you mean by 'custom box', is it something like an old blue box or something?

     

    Glad to get one more member, welcome  /no1

     

    (Doesn't seem like a database problem at all unless you created some new sql data but that wouldn't make your client crash, to me it's most likely a client-side issue)

  4. There is a great example of bitmasks use in the script commands, it's pretty simple and useful:

    The bitwise operator AND (&) is used to test two values against each other, 
    	and results in setting bits which are active in both arguments. This can
    	be used for a few things, but in rAthena this operator is usually used to
    	create bit-masks in scripts. 
    	
    	The bitwise operator OR (|)sets to 1 a binary position if the binary position
    	of one of the numbers is 1. This way a variable can hold several values we can check,
    	known as bit-mask. A variable currently can hold up to 32 bit-masks (from position 0
    	to position 1). This is a cheap(skate) and easy way to avoid using arrays to store several checks
    	that a player can have.
    	
    	A bit-mask basically is (ab)using the variables bits to set various options in 
    	one variable. With the current limit if variables it is possible to store 32 
    	different options in one variable (by using the bits on position 0 to 31).
    
    	Example(s):
    	- Basic example of the & operator, bit example:
    		10 & 2 = 2
    	Why? :
    		10 = 2^1 + 2^3 (2 + 8), so in bits, it would be 1010
    		2 = 2^1 (2), so in bits (same size) it would be 0010
    		The & (AND) operator sets bits which are active (1) in both arguments, so in the
    		example 1010 & 0010, only the 2^1 bit is active (1) in both. Resulting in the bit
    		0010, which is 2.
    	- Basic example of creating and using a bit-mask:
    		set @options,2|4|16; //(note: this is the same as 2+4+16, or 22)
    		if (@options & 1)	mes "Option 1 is activated";
    		if (@options & 2) mes "Option 2 is activated";
    		if (@options & 4) mes "Option 3 is activated";
    		if (@options & 8) mes "Option 4 is activated";
    		if (@options & 16) mes "Options 5 is activated";
    

    I guess you'd have to edit the 'getiteminfo' script command in order to get the job type of items

    Job: Which jobs this item is available for. Values below can be combined to achieve availability for multiple job classes, i. e. 0x2|0x4 -> 0x6 (Swordman+Mage)
    
    (S.) Novice         (2^00): 0x00000001
    Swordman            (2^01): 0x00000002
    Mage                (2^02): 0x00000004
    Archer              (2^03): 0x00000008
    Acolyte             (2^04): 0x00000010
    Merchant            (2^05): 0x00000020
    Thief               (2^06): 0x00000040
    Knight              (2^07): 0x00000080
    Priest              (2^08): 0x00000100
    Wizard              (2^09): 0x00000200
    Blacksmith          (2^10): 0x00000400
    Hunter              (2^11): 0x00000800
    Assassin            (2^12): 0x00001000
    Unused              (2^13): 0x00002000
    Crusader            (2^14): 0x00004000
    Monk                (2^15): 0x00008000
    Sage                (2^16): 0x00010000
    Rogue               (2^17): 0x00020000
    Alchemist           (2^18): 0x00040000
    Bard/Dancer         (2^19): 0x00080000
    Unused              (2^20): 0x00100000
    Taekwon             (2^21): 0x00200000
    StarGladiator       (2^22): 0x00400000
    Soul Linker         (2^23): 0x00800000
    Gunslinger          (2^24): 0x01000000
    Ninja               (2^25): 0x02000000
    Gangsi              (2^26): 0x04000000
    Death Knight        (2^27): 0x08000000
    Dark Collector      (2^28): 0x10000000
    Kagerou/Oboro       (2^29): 0x20000000
    Rebellion           (2^30): 0x40000000
    All Classes               : 0xFFFFFFFF
    Every Job Except Novice   : 0xFFFFFFFE
    

    This way you'd be able to use bitmasks with the 'BaseJob' player variable and so telling if the item is wearable by the player.

  5. There you go for a '@name2ip <name>' command

    -	script	At_name2ip	-1,{
    OnInit:
    	.DBname$ = "ragnarok"; // set this to your database name (mine is ragnarok)
    	bindatcmd "name2ip",strnpcinfo(0)+"::OnCommand",99;
    	end;
    	
    OnCommand:
    	.@ip$ = getcharip(.@atcmd_parameters$);
    	query_sql("SELECT `online` FROM `"+.DBname$+"`.`char` WHERE `name` = '"+.@atcmd_parameters$+"' AND `online` = '1'",.@online);
    	
    	if (.@atcmd_parameters$ == "") dispbottom "Your IP address is "+.@ip$;
    	else if (.@ip$ == "") dispbottom "Player "+.@atcmd_parameters$+" can't be found in database, please make sure you tipped the right name";
    	else dispbottom "The latest IP address of player "+.@atcmd_parameters$+" was "+.@ip$+" (player currently "+(.@online?"online":"offline")+")";
    	end;
    }
    

    you just have to type '@name2ip <name of the character>' to retrieve the ip adress of the player, you will get your ip address if you didn't put any name (even though it's a but useless I admit).

    I have no idea what you'd want it to look like and I also didn't test it so don't hesitate to ask for more.

     

     

    If you still want to access that ip adress by right clicking on somebody, you should ask the source support section but I don't even know if that's possible whithout editting the client which would probably be a pain. No real idea there, it doesn't hurt to ask anyway ^^

     

    (Actually if dejavu means you're french, I'm too so that may be more comfortable to talk in french if you need anything)

  6. Ahhh, ok I'm an idiot ^^

     

    There it goes:

    if( md->npc_event[0] && !md->state.npc_killmonster ) {
    	if( sd && battle_config.mob_npc_event_type ) {
    		++ pc_setglobalreg(sd, add_str("killedgid"), md->bl.id);
    		pc_setparam(sd, SP_KILLEDRID, md->mob_id);
    		pc_setparam(sd, SP_KILLERRID, sd->bl.id);
    		npc_event(sd,md->npc_event,0);
    	} else if( mvp_sd ) {
    		++ pc_setglobalreg(mvp_sd, add_str("killedgid"), md->bl.id);
    		pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id);
    		pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);
    		npc_event(mvp_sd,md->npc_event,0);
    	} else
    		npc_event_do(md->npc_event);
    } else if( mvp_sd && !md->state.npc_killmonster ) {
    	++ pc_setglobalreg(mvp_sd, add_str("killedgid"), md->bl.id);
    	pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id);
    	npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
    } 

    (edited to fit the latest revision)

     

    working perfectly.

     

    Thanks a lot for this, I'll make good use of that game id  ;)

  7. It is (r17726)

     

    I'm using this as a test

    -	script	vartest	-1,{ // @test <id> will spawn the mob and give you the '$@mobid' and 'killedgid' var upon spawn and death
    OnInit:
    	bindatcmd "test",strnpcinfo(0)+"::OnTest";
    	end;
    
    OnTest:
    	deletearray $@mobid; // just to be sure
    	getmapxy .@map$,.@x,.@y,0;
    	monster .@map$,.@x,.@y,"test",atoi(.@atcmd_parameters$),1,strnpcinfo(0)+"::OnMobDead";
    	announce "game id : "+$@mobid,0;
    	end;
    
    OnMobDead:
    	announce "killedgid : "+killedgid,0;
    	end;
    }
  8. Hi there.

     

    I'd like to be able to display an announce that can't be seen in the chat, the same way the hunting quests work (when you kill a monster in a hunting quest you see the amount you've killed on your screen but not in the chat, that allows you to display informations without flooding the chat, which I find quite nice that's the reason I'm looking for this).

     

    I've already looked at this part of the clif.c :

    /// Notification of an update to the hunting mission counter (ZC_UPDATE_MISSION_HUNT).
    /// 02b5 <packet len>.W <mobs>.W { <quest id>.L <mob id>.L <total count>.W <current count>.W }*3
    void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd)
    {
    	int fd = sd->fd;
    	int i;
    	struct quest_db *qi = quest_search(qd->quest_id);
    	int len = qi->num_objectives * 12 + 6;
    
    	WFIFOHEAD(fd, len);
    	WFIFOW(fd, 0) = 0x2b5;
    	WFIFOW(fd, 2) = len;
    	WFIFOW(fd, 4) = qi->num_objectives;
    
    	for( i = 0; i < qi->num_objectives; i++ ) {
    		WFIFOL(fd, i*12+6) = qd->quest_id;
    		WFIFOL(fd, i*12+10) = qi->mob[i];
    		WFIFOW(fd, i*12+14) = qi->count[i];
    		WFIFOW(fd, i*12+16) = qd->count[i];
    	}
    
    	WFIFOSET(fd, len);
    }
    

    but I don't get anything about how the client manages to diplay messages  :lol:

     

    That'd be nice to have a script command for this, that'd allow me not to use the official quest system anymore (I'm not a big fan of the official quest system because you can't make nice quests apart from 'go kill those monsters, I love blood!' which is a bit restrained ^^).

     

    Thanks for reading and for your support.

  9. try to create a quest which has a short time limit and complete it. Once you reach the time limit check it again and you'll know.

     

    It all depends on wether the timer is deleted upon completion or not, if I were to one who created it I would delete the timer since it would be useless to continue running it.

  10. No that's not it, even by deleting the array and spawning only one mob I get wrong values.

     

    Actually the $@mobid value increments each time a monster is spawned, which is normal..

     

    But the killedgid value doesn't increment the way it's supposed to: if I spawn only one monster the value doesn't change and if I spawn a Mvp its value changes but in a weird way, it gains the number of slaves summoned by the Mvp.

     

    For example:

    • if I spawn porings the value of 'killedgid' is always the same
    • if I spawn a Moonlight Flower, who summons 3 slaves, I get the value 'killedgid' = n and when I spawn another one the new value is 'killedgid' = n+3

    (I'm spawning monsters whith the script commands not via @monster)

     

    To me it appears that the 'killedgid' variable is working fine only with Mvp slaves, which is really weird because I placed it in the same place than the 'killerid' in the mob.c file and the 'killedrid' variable is working perfectly fine.

     

    also using add_str("killedgid") instead of "killedgid" makes my map-serv crash when one of a Mvp slave dies

  11. Ah nice

    } else if( mvp_sd && !md->state.npc_killmonster ) {
    	pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id);
    	pc_setglobalreg(mvp_sd, "killedgid", md->bl.id);
    	npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
    }
    

    works fine thank you


    I just noticed it doesn't work, the variable 'killedgid' is set to a value that corresponds to a game id but that value is different from the one I get from the '$@mobid' var

     

    For example when I spawn a mob I get the value 110267231 via the $@mobid variable and I get the value 110157627 via the killedgid variable once I kill it.

  12. Thanks for your answers.

     

    Nice I'll give it a try as soon as I have an internet connection deserving that name ^^

     

    Loading mobs isn't a problem I was just looking for the sprites. I'm planning to make them custom mobs anyway.

     

    By the way, what is the difference between kRO and jRO clients? Why do we mostly find jRO ones?

  13. Hello everyone.

     

    I took a look at the npc sprites from that website and there are a bunch of sprites I'd like to get that are not in my grfs even with the latest grf files. Especially the pad monsters starting from id 3315.

     

    Since those aren't added in the mob_db of the latest revision, I guess it's normal but still I'd really like to get those sprites :) Does anyone know a way to get them?

     

    Thanks in advance, take care  /no1

  14. I think this might correspond to what you're looking for : https://github.com/rathena/rathena/blob/master/npc/custom/quests/hunting_missions.txt

     

    It's only about hunting monsters, there's no item collection quests but if you want us to add it you'd need to make a list of items because asking for random items is likely to make the quest impossible (if the item can't be found).

     

    There are quite a few scripts of the genre but to me this one is the best (only my opinion though).

     

    I think you should try it out and think about whether you want to add an item function but if you want to and you also want to use this script you'll definitely have to make a list of items with their value (since this script gives you points after completing a mission you can use in a shop).

     

    Hope you find it useful, don't hesitate to ask anything if needed.

  15. Hello there :)

     

    I've been looking for a way to get the gid of a monster when he dies by using the OnNPCDieEvent label but since I'm like really really bad at source stuff none of the things I tried worked out, could you lend me a hand please?

     

    I guess I would have to edit this part in the mob.c file :

    } else if( mvp_sd && !md->state.npc_killmonster ) {
    	pc_setparam(mvp_sd, SP_KILLEDRID, md->mob_id);
    	npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
    }
    

    the "killedrid" variable is set to the mob id and I'd like to get its game id, I'd probably name it "killedgid".

     

    Thanks in advance  ;)

  16. File Name: warn.txt

    File Submitter: Kurofly

    File Submitted: 10 Jun 2015

    File Category: Utilities

    Content Author: Kurofly


    It's a really simple script which warns some players when used.

    I made use of it to be warned if something didn't go right in some big scripts where you can be lost.
    It helped to correct some bugs more easily and to catch some people trying to cheat :P

    It's used like this:

    callfunc "WarnMe","this is a test","<your player name>","<other player name>"{,"<other player name>",{...}};//it will send a notification to all players mentionned, if they're not connected they'll receive it on relog


    I'll give you an example:

    while (getvariableofnpc(.battle,getarg(0))) {		if (getpetinfo(0) != getvariableofnpc(.pet_gid,getarg(0))) { callfunc "WarnMe",""+strcharinfo(0)+" a change de pokemon","kuro" ; dispbottom "C'est pas bien d'essayer de tricher...",0xffff00 ; end; }


    It tells me if someone changes his pet during a pokemon fight and so I can punish him :lol:

    Well it's not something you'd often use but it can be ueful sometimes.



    Click here to download this file

  17. If you don't mind, can I ask you two questions? ^^

     

    Why do you use a function for setting the level back to normal?

    Why don't you replace this

    if( !compare( implode( .maps$, ":" ), .@map$ ) ) end;
    

    by this?

    if( !compare( implode( .maps$, ":" ), .@map$ ) ) { callfunc( "PVPLP_revertLevel" ) ; end;}
    
    

    so that players can get their level back when they leave the map instead of having to disconnect.

     

    Also make sure players loose their stat points when their level is set to a lower value because I don't think it recalculates it automatically.

    • Upvote 1
  18. You will never make your server crash or lag with that script xD

    But still I wouldn't recommend you to clean the maps if players are on it because it will eventually kill the monsters they just spawned.

    -	script	KillMobs	-1,{
    
    OnInit:
    OnTimer600000:
    	if (!getmapusers("New_1-3")) killmonster2 "New_1-3";
    	if (!getmapusers("New_2-3")) killmonster2 "New_2-3";
    	if (!getmapusers("New_3-3")) killmonster2 "New_3-3";
    	if (!getmapusers("New_4-3")) killmonster2 "New_4-3";
    	if (!getmapusers("New_5-3")) killmonster2 "New_5-3";
    	initnpctimer;
    	end;
    }
    

    It will clean the map every 10 minutes only if there are no players on them

     

    Don't worry you won't lag at all even if there are thousands of mobs in them ^^

  19. This is normal don't worry.

     

    When using the 'npcshopattach' script command you can change the shop behavior but the source script still shows you "the deal was successfully completed" when you close the shop.

    Even so, it won't bother the script behavior.

     

    Edit: ahhh! I thought you were talking about the blue message xD don't mind what I said then

  20. for(.@e = 0; .@e<4; .@e++){
    	set .@r,rand(1,.L[3]);
    	set .@s[.@e],getd(".M" +.@r+"["+.@r+"]");
    }
    

    always inside  ;)

     

    For the other one you can't use the whole array as an argument.

    I think I heard somewhere that you can pass player array variables in functions but I never tried it

     

    So you have two choices:

    • Either you use a @var[] array and then use it in your function
    • Or you pass the name of the array to your function so that it can get the variables using getvariableofnpc() and getd()

    note that you'l have to give your array lenght to your function

     

    for example :

    -	script	YourNPCName	-1,{
    callfunc "YourFuncName",".myarrayname",getarraysize(.myarrayname);
    }
    
    function	script	YourFuncName	{
    	for (.@i = 0 ; .@i < getarg(1) ; .@i++)
    		debugmes "val "+.@i+" : "+getvariableofnpc(getd(getarg(0)+"["+.@i+"]"),"YourNPCName");
    	return;
    }
    
    • Upvote 1
  21. Thanks for your answer as well.

     

    In fact I have a party bonus script wich gives drop bonus to grouped players on the same map.

    At the same time I have an the rare_drop_announce activated for items  with 1% or less drop rate.

     

    I'd have liked to display the value of the bonus the group has, along with the drop announce but I need to find a way to know when a monster drops an item with 1% or less chance.

     

    So even if some monster drops are skipped it won't be a big deal, maybe sometimes an announce won't show that's all.

     

    I know nothing about src and I just thought setting global variables would be an easy task but if you think there's a better way to do it I'd be glad to hear it  /no1

×
×
  • Create New...