Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kurofly

  1. Take you current script and look for all of these callfunc "VoteExchange",strnpcinfo(1),1,7539,1; then turn them to this callfunc "VoteExchange",strnpcinfo(1),1,7539,1,getcharid(3,strcharinfo(0)); then look for tis one function script VoteExchange { and turn it to this function script VoteExchange { attachrid(getarg(4));
  2. I don't understand >< Can you explain it better for me? Tell me what you want to do with your script. Also aren't you blocked if you waited enough time? Because it just tells you that you can do another quest but it doesn't reset it.
  3. I read the script really quickly so I didn't really get what you want to do but I know one thing for sure. You won't be able to use this function if you don't attach the player rid to it because functions are not attached to players automatically. It's a bit strange that Mytzer submitted it like this because at first sight it seems obvious that it won't work Maybe he found a way to use his function without attaching any rid but normally you can't. So basically you'd have to give the player rid as a parameter to the function so that it can attach the player to the script before using message commands: Just add an argument like this: callfunc "VoteExchange",strnpcinfo(1),1,7539,1,getcharid(3,strcharinfo(0)); and attach the rid in the function: function script VoteExchange { attachrid(getarg(4)); set .@CurrVotePoints, callfunc("getVotePoints"); ...
  4. To reset the ranking I usually use one of these two options: Either you choose to store the ranking variables as player variables, so here's what you'd have to do: -Each time a player kills a MVP, store the player rid (with getcharid(3,strcharinfo(0))) in a permanent array but only if it wasn't in it already. -When you want to reset the ranking attach the rid of each player and set their variables to 0. -All players definitely won't be online the exact time you want to reset their variables so you will have to copy the array in another array and check, each time a player logs on, if one of the players' ranking left to reset is that of the player that just logged (not sure if I'm really clear about it ><) You will have those problems using this method: -If more than 128 players play your server, you will have to make sure the array doesn't get more than 128 rid because it won't handle it (you can use more arrays but it's pretty annoying) -If you want to display the players rank you will have to make sure to find a way to prevent players left to be reset not to be displayed on the list (I only read quickly your script so I can't tell you excatly how, it depends on how you did it) Or you can choose to store ranking variables as NPC variables doing something like: setd "."+strcharinfo(0)+"_ranking" , getd("."+strcharinfo(0)+"_ranking") + 1; //when a player kills a MVP setarray .ranking_names$[getarraysize(.ranking_names$)] , strcharinfo(0); //so that you can display it on your board On reset you can just set those variables to 0 and delete the array '.ranking_names$' But you will also have problems using this method : -Again if more than 128 different players kill some MVPs, you'll have to create other arrays -If you want to keep the rankings after a reloadscript you'll have to use global arrays The second metod is cleary the simplier one here but I just wanted to inform you on the first one because it is often simplier in different situations and when it comes to a lot of variables, it's not recommended to use global variables. Sorry I guess you though I would post it for you but I neither have time nor motivation to do it . Still I think it's a good idea to try it yourself, you'll see that it's not as easy as it seems but if you never tried something like this before you'll learn a lot. Good luck As I said I don't have time right now but if you don't manage(or you do want) to do it I'll do it for you but only in a week or two
  5. It probably is. Judging from some of my scripts I would say you can do pretty much all you want with simple executions. But it's something pretty easy to test, spawn hundreds of monsters in a restricted area with 2 or 3 members in your group and kill them all you'll see^^ Still i don't understand some things in your script. If I get it right you want to give, to all players in a group on the same map, one item each time any of the group members kill a monster. Then you could probably shorten it: //For each player in group //if player online //if player alive //if player on the same map getitem ...; getpartymember won't give you twice the same player and since you are using temporary NPC variables they will be deleted once the script ends so there would be no use of a character id checking. But still I'm really curious about why you want to give players so many items Maybe I didn't get it, if that's the case I'm sorry
  6. No problem it's also my bad to have used a similar title.
  7. Yeah I know I just wanted to make my script shorter but seems like I can't. Anyway thank you for your support, I really appreciate it
  8. I'll try to explain what I'm trying to do in details ^^ thank you guys for showing interest in this. I'm making kind of a pokemon script which allows players to get a pokemon as a pet and to train him battling against other pokemons in a specified area. In this area there are some NPC with pokemon monster sprite ids (those who are marked with a sword like monsters when you put your mouse on them and who you have to touch to start a script) When you touch one of those pokemons it starts a fight with it, you're warped somewhere else and only pokemons can fight. Since I want it to be able to manage more than one fight at once(in different maps though), I choosed to make a NPC in charge of managing fights in his map. So now I need to duplicate this NPC, and since one of them takes approximately 200 lines to manage a fight I didn't want to copy-paste 10 of them. So I started to test 2 or 3 things using duplicates to see if I could reduce the amount of lines in my script Here is what I tried to do (those are just examples) : - script testttttt -1,{ OnInit: bindatcmd "test",strnpcinfo(0)+"::OnTest"; end; OnTest: set getvariableofnpc(.var,"testnpc") , -1; //works but set it for all duplicates.. set getvariableofnpc(.var,"BattleNPC#1::testnpc") , 1; //doesn't work donpcevent "BattleNPC::OnLabel"; donpcevent "BattleNPC#1::OnLabel"; donpcevent "BattleNPC#1::testnpc::OnLabel"; donpcevent "testnpc::OnLabel"; //can't access 'OnLabel' label with these } poring_w01,105,110,4 script BattleNPC#1::testnpc 53,{ mes "" , "value assigned : "+.var; close; OnInit: debugmes "NPC "+strnpcinfo(2)+" successfully called 'OnInit' label"; end; OnLabel: debugmes "NPC "+strnpcinfo(2)+" successfully called 'OnLabel' label"; disablenpc strnpcinfo(0); disablenpc strnpcinfo(1); disablenpc strnpcinfo(0)+"::"+strnpcinfo(3); //none of them work } poring_w01,106,110,4 duplicate(testnpc) BattleNPC#2 53 poring_w01,107,110,4 duplicate(testnpc) BattleNPC#3 53 Judging from my tests the OnInit label only goes with the first NPC (the one not duplicated) and then I can't access other labels from any of these NPCs anymore. I can set a variable using the unique name of the NPCs but all of them will have the same value. I also can't disable them I never duplicated any NPC before so I'm not used to it but it seems many things are not possible using duplicates. Basically I would want those duplicates to be able to have their own variables and to manage their actions calling labels, I would also want to use npc timers in each of those. Hope you guys understand what I mean, sorry for my bad english if I can't manage to make myself clear enough and thank you
  9. Thank you for your reply. I know that already but it doesn't work for duplicates, I tried to use 'NpcName#num' and 'NpcName#num::UniqueName' as the npc name using getvariableofnpc , donpcevent and doevent but none of them seem to work with duplicates. It also seems that the OnInit Label only works for the first NPC and not for the others. I worked a lot using these commands so I know well how to use them and what I am not able to do with them but I never tried to use them on duplicates before. Maybe it is possible in a specific way or maybe not, I would juste want to make sure Thanks again for your reply.
  10. Hello Ra! I can't seem to find a way to either call a label from a duplicate or set a variable of a duplicate to a value using getvariableofnpc(). Is it even possible to acces labels/variables from duplicates? Help needed
  11. May I ask why this topic is marked solved?
  12. Hello rA! I'm trying to make a pet return to its egg and I couldn't seem to find any command that could be useful to me. So I started to look for a source function and I found one * Return a pet to it's egg. * @param sd : player requesting * @param pd : pet requesting * @return 1 */ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) { struct item tmp_item; unsigned char flag = 0; pet_lootitem_drop(pd,sd); memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = pd->petDB->EggID; tmp_item.identify = 1; tmp_item.card[0] = CARD0_PET; tmp_item.card[1] = GetWord(pd->pet.pet_id,0); tmp_item.card[2] = GetWord(pd->pet.pet_id,1); tmp_item.card[3] = pd->pet.rename_flag; if((flag = pc_additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) { clif_additem(sd,0,0,flag); map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); } pd->pet.incubate = 1; unit_free(&pd->bl,CLR_OUTSIGHT); status_calc_pc(sd,SCO_NONE); sd->status.pet_id = 0; return 1; } But I have no idea how to call this function from a script Could someone give me a hint on how to make script commands or just on how to call a source function? That'd be very nice
  13. Hello everyone. In one of my scripts I would have to perform a sql table modification with the game id of a pet as the primary key. I would also have to perform it the moment I make the pet egg. So i wonder if someone could help me making the makepet/makeegg buildin_func return the game id of the pet created? Thanks in advance EDIT: SOLVED I solved my problem querying the pet sql data to get the last pet id just after having made one and it works fine. Sorry not to have thought about it sooner..
  14. Hello rA; I'm trying to use the 'getunitdata' on a homunculus but it seems the game id I get from the gethominfo(0) is incorrect: and here is the script: .gid = gethominfo(0); dispbottom "Your homunculus gid is : "+.gid; getunitdata .gid , .data; dispbottom "His master's character id is : "+.data[6]; Does anyone know how to get the game id of an homunculus properly?
  15. Hmm. I looked for the feature in features.conf but mine is marked enabled but it still tells me auction system disabled in game EDIT: this feature is not stable on 2012-04-10 packetever that's why it's being disabled. I'll maybe change it later to also use the iteminfo
  16. Oh cool I'll check that out as soon as I go back home. Ty
  17. Updating svn will cause conflicts with the files you edited yourself if those were updated. If a conflict is detected it will acts accordingly but won't overwrite what you edited. Look for the >>>>>>>> and <<<<<<<< to see where those conflicts are. So your update probably changed some parts that were not modified but kept the parts you edited. Judging from your error you probably have somewhere an SP factor lower than the one on previous level. Just get a new job.db from github that should solve your problem. pre-re re However, I cannot guarantee tis error comes from your job.db, just give it a try you'll see.
  18. Kurofly

    Auto shop

    Version 2.0

    878 downloads

    This script will allow players to shop their items while playing via a shop NPC, this is kind of an alternative to the auction system. Note: There's also a french version since I'm french ^^ There is a user setup, be sure to check it out ! User can add a cost to shop creation and/or a tax, there's also a delay after which the shop is deleted. Players can create a shop using an item or via the '@shop' command, depending on the mode value in the user setup Players can shop any kind of item apart from bound and time-limit items You can add items, change prices, modify your shop name anytime using the '@shop' command You can disconnect and reconnect anytime, if you sold something and/or your shop was deleted you will get your money and items on relog In case the server reboots you also get back the shop creation's cost or the item you used to open it Please report any bug you find. If I can't answer you while you are experiencing bugs, consider following this step: Make sure no one is selling when you do this because they will loose all of their sales !! Note: you can just reloadscript before doing this to give them back all of their items. //bindatcmd "delall",strnpcinfo(3)+"::OnDelall",99,99; /*In case you have problems I recommend you to uncomment this command and to execute it. It will erase all the data of every shop and every player. I myself experienced some issues not directly related to the script but to unexpected events so reseting data should temporarly solve the problem. Please contact me on rA (Kurofly) if you experience any bug*/
    Free
  19. Did you try Euphy's quest shop ? It should work fine.
  20. Hi there; When I try to use the 'setunitdata' command to change the mode of a monster, it doesn't change anything. Using getunitdata to get the index n°9 (mode) of a monster, I get 0 for the mode value. Sorry wrong manip, I get the good value using getunitdata I tried to change the Hps of a monster and it works. I also tried to use both number and bit mode but it doesn't change anything. The mapserv doesn't show any error. Need help
  21. Hello rA people ! I would like to make monster A hit monster B without monster B counter-attacking. I tried to use unitstop with different timings and even using it every 10ms for 2s but monster B only stops after having attacked once. If anyone has an idea to solve my problem, I'm taking it EDIT: i found a way out using setunitdata to disable the can attack mode of the monster so that's kinda solved
  22. Oh god! This means I can edit whatever data of any monster at any time and in-game!? That's awesome! Thanks a lot for that, I'll definitely make use of it edit: I'm sorry to have asked help for this since it's in the script commands but this command is not in my documentation. Should have looked directly on internet ^^
  23. Hi there; That'd would very nice if I had the possibility of spawning a monster with a defined amount of HP. I thought a bit about it and didn't find any solution other than creating a script command like: monster2 <"map name">, <x>, <y>, <"display name">, <mob id>, <amount>, <amount of HPs>[, <"event label">]; If someone could make that for me, that'd be really cool Kindly let me know if anyone knows another way to do it, I didn't manage to find one myself. Thanks in advance
  24. I can't find any informations about this auction system. When i type @auction it tells me "auction system is disabled". Do you have a link or something?
  25. Sure but that makes a lot of NPCs to create. Seems like I don't have choice ^^
×
×
  • Create New...