-
Posts
1,658 -
Joined
-
Last visited
-
Days Won
67
Community Answers
-
sader1992's post in Additional Function was marked as the answer
- script LevelUpQuotes -1,{ OnInit: setarray .q$,"I have advanced forward!","There's no stopping me now!","Look at me go!","There's more where that came from.","This isn't even my final form!"; .num1 = getarraysize(.q$); end; OnPCBaseLvUpEvent: if(!(BaseLevel%10)){ getitem 501,10; [email protected] = rand(.num1); showscript strcharinfo(0)+" : "+.q$[[email protected]]; } end; }
-
sader1992's post in How To Add @commands to normal account was marked as the answer
this ill only log the commands of the normal users , and it's not recommended , you add a command like that
go: true
this mean the normal users now can use @go
ofc under the id 0 group level 0 for the normal users
-
sader1992's post in Enchant Script not working with random option, getitem3 issue? was marked as the answer
given that everything is right in the script , and your error is only on delitem3 , use
delequip [email protected]_loc; instead of delitem3
you still need the information to create a new item , but this insure that even if you missed some information about the item (like identify and attribute) the item will get deleted safely and the player can't abuse the system
also you don't need those
setarray [email protected][0],0; setarray [email protected][1],0; setarray [email protected][2],0; setarray [email protected][3],0; setarray [email protected][4],0; setarray [email protected][0],0; setarray [email protected][1],0; setarray [email protected][2],0; setarray [email protected][3],0; setarray [email protected][4],0; setarray [email protected][0],0; setarray [email protected][1],0; setarray [email protected][2],0; setarray [email protected][3],0; setarray [email protected][4],0;
and your forloop for getting the random options
from
for ([email protected] = 0; [email protected] < 5; [email protected]++) { setarray [email protected][[email protected]],getequiprandomoption([email protected]_loc,[email protected],ROA_ID); setarray [email protected][[email protected]],getequiprandomoption([email protected]_loc,[email protected],ROA_VALUE); setarray [email protected][[email protected]],getequiprandomoption([email protected]_loc,[email protected],ROA_PARAM); } to
for ([email protected] = 0; [email protected] < 5; [email protected]++) { [email protected][[email protected]] = getequiprandomoption([email protected]_loc,[email protected],ROA_ID); [email protected][[email protected]] = getequiprandomoption([email protected]_loc,[email protected],ROA_VALUE); [email protected][[email protected]] = getequiprandomoption([email protected]_loc,[email protected],ROA_PARAM); }
-
sader1992's post in Announce # of people on Pub upon entry was marked as the answer
*set <variable>,<expression>{,<char_id>}; set [email protected],getwaitingroomstate(0,"Waiting"); you missed a comma , read the console errors before anything.
-
sader1992's post in How to remove Monster from database? was marked as the answer
don't remove the monsters from the database
just remove the spawn
check https://github.com/rathena/rathena/tree/master/npc/pre-re/mobs
-
sader1992's post in mapflag noskill wot was marked as the answer
- script noskill_mapflag_remove -1,{ OnInit: if(getmapflag("prt_are_in",mf_noskill)) removemapflag "prt_are_in",mf_noskill; end; } put it at the end of your scripts list
so it would load last
-
sader1992's post in Maximun Event Queue was marked as the answer
you better not delay the events if you have too many of the same type.
the maximum number is 3
after that the events will be deleted instead of moving to the queue.
https://github.com/rathena/rathena/blob/05ebde0198380c100c92b7873c86ee93b811032d/src/map/map.hpp#L49
-
sader1992's post in Adding Maps deletes other maps? was marked as the answer
Do not input map id and put it in the text in the import not in re/pre-re , put your gat into the import map cache, read the console errors if there is any.
-
sader1992's post in Use application gateway IP can't not runserver was marked as the answer
conf/import/char_conf.txt login_ip: 127.0.0.1 char_ip: public_ip conf/import/map_conf.txt char_ip: 127.0.0.1 map_ip: public_ip
-
sader1992's post in OnPCStatCalcEvent and recalculatestat; Loop was marked as the answer
--------------------------------------- *recalculatestat; This command will force a stat recalculation for the attached player. --------------------------------------- OnPCStatCalcEvent: This special label triggers when a player's stats are recalculated, such as when changing stats, equipment, or maps, as well as when logging in, leveling up, and mounting a job mount. This can be used to grant additional item bonuses to certain player groups, for instance. technically , you are asking for loop
I would suggest to not use OnPCStatCalcEvent unless you are forced too
also I don't understand why disable/enable a npc like that , let's say the script works , the npc would be always disabled depending on the number of players in the server , also I am not sure that you know what you are doing.
-
sader1992's post in How to set Dungeon as town was marked as the answer
https://github.com/rathena/rathena/blob/master/npc/mapflag/town.txt
https://github.com/rathena/rathena/blob/master/npc/mapflag/restricted.txt
-
sader1992's post in (Request)Max level rewards npc was marked as the answer
prontera,0,0,0 script npc_name 444,{ if($MAX_LEVEL_REWARDS_50 < 50){ if(!#MAX_LEVEL_REWARDS_50){ if(BaseLevel == 99){ mes "you can redeem the reward once per account!"; if(select("redeem with this char:close") == 2) end; #MAX_LEVEL_REWARDS_50 = true; $MAX_LEVEL_REWARDS_50++; mes "you got the reward!"; announce "Player '" + strcharinfo(0) + "' has redeemed his max level reward!",0; //=========================== getitem 502,1;//add what you want to give like this. //=========================== close; }else{ mes "you are not at the max level!"; close; } }else{ mes "you alewady redeemed the reward with another char!"; close; } }else{ mes "All the rewards has been redeemed!"; close; } }
-
sader1992's post in Custom Costume Wings not displaying was marked as the answer
try to add in in data\luafiles514\lua files\transparentItem\transparentItem.lub too
{ 51, 255, 255, 25500 },
the tool was built before this file
-
sader1992's post in Enable the use of Ice Wall on Maps. was marked as the answer
it's most likly https://github.com/rathena/rathena/blob/master/db/re/skill_nocast_db.txt
but there is also a mapflag to prevent casting icewall , so check that too in your npc folders
-
sader1992's post in Random Option Removed when Enchanting was marked as the answer
the script is not supported anymore , and it does not support random option , i suggest you create a script that does only what you need instead of using any type of "all in one" scripts
however , this should make the random options work
sader_s_enchant_V2.6_(with random option support).txt
-
sader1992's post in open shop by command was marked as the answer
I suggest then creating categories instead of one shop
- script impossible_shop_command -1,{ OnCommand: [email protected] = select("shop0:shop1:shop2:shop3:shop4:shop5:shop6"); callshop "impossible_shop_" + [email protected],1; end; OnInit: bindatcmd("brindes",strnpcinfo(3)+"::OnCommand",0,99); end; } - pointshop impossible_shop_0 -1,impossible_shop_points,502:100,503:20; //put the items here; - pointshop impossible_shop_1 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_2 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_3 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_4 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_5 -1,impossible_shop_points,502:100,503:20; - pointshop impossible_shop_6 -1,impossible_shop_points,502:100,503:20;
-
sader1992's post in Any suggestion for matrix? was marked as the answer
--------------------------------------- *setd "<variable name>",<value>{,<char_id>}; Works almost identically as set, except the variable name is identified as a string and can thus be constructed dynamically. This command is equivalent to: set getd("variable name"),<value>; Examples: setd "[email protected]$", "Poporing"; mes [email protected]$; // Displays "Poporing". setd "[email protected]" + [email protected]$ + "123$", "Poporing is cool"; mes [email protected]$; // Displays "Poporing is cool". NOTE: 'char_id' only works for non-server variables. Player with Character ID 'char_id' must be online. --------------------------------------- *getd("<variable name>") Returns a reference to a variable, the name can be constructed dynamically. Refer to 'setd' for usage. This can also be used to set an array dynamically: setarray getd(".array[0]"), 1, 2, 3, 4, 5; Examples: set getd("$varRefence"), 1; set [email protected], getd("$" + "pikachu"); --------------------------------------- example:
setarray [email protected],1,2; setarray [email protected],10,20,30,40,50; setarray [email protected],100,200,300,400,500; for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ for([email protected]=0;[email protected]<getarraysize(getd("[email protected]" + [email protected][[email protected]]));[email protected]++){ debugmes "" + getd("[email protected]" + [email protected][[email protected]] + "[" + [email protected] + "]"); } }
-
sader1992's post in utilities.cpp error in laste rathena version was marked as the answer
i think it's you who reported about the issue in github , anyway for anyone who have the same issue , the fix is here
https://github.com/rathena/rathena/pull/4552
-
sader1992's post in Client crashes on some maps was marked as the answer
use the map files from an older data/rdata
-
sader1992's post in Script event when clone kills another clone was marked as the answer
the clone command return the monster gid
so you can just save the gid and check for it
like
.PlayerOneClone = clone("prontera",155,155,"NpcName::OnEvent",1); .PlayerTwoClone = clone("prontera",145,145,"NpcName::OnEvent",2); end; OnEventOne: if(!unitexists(.PlayerOneClone)){ //player one clone is dead } if(!unitexists(.PlayerTwoClone)){ //player two clone is dead } end;
also the event name, you can just use different event name for each clone
like
clone("prontera",155,155,"NpcName::OnEventOne",1); clone("prontera",145,145,"NpcName::OnEventTwo",2); end; OnEventOne: //player one clone is dead end; OnEventTwo: //player two clone is dead end;
here a long example :
let's clone everyone in prontera , than we check every time one of the mobs are dead we output a debugmes for the char id of the player
(i didn't test it , i just wrote it as an example , i don't know even if it will work but technically it should work)
getmapunits(BL_NPC,"prontera",[email protected]); for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ [email protected] = getarraysize(.charList); .charList[[email protected]] = convertpcinfo([email protected][[email protected]],CPC_CHAR); .mobList[[email protected]] = clone("prontera",155,155,"NpcName::OnEvent",.charList[[email protected]]); } end; OnEvent: for([email protected]=0;[email protected]<getarraysize(.mobList);[email protected]++){ if(.mobList[[email protected]] && !unitexists(.mobList[[email protected]])){ //the monster has been found. //we save it. [email protected] = .charList[[email protected]]; [email protected] = .mobList[[email protected]]; //we delete it from the array. deletearray .charList[[email protected]],1; deletearray .mobList[[email protected]],1; //we break out. break; } } //now we have the here [email protected] = the player id , [email protected] = the monster gid debugmes "" + [email protected]; debugmes "" + [email protected];
-
sader1992's post in Freebies Gepard (UniqueID) was marked as the answer
if you are planing to use the unique id more in the future , i would suggest using this
the script would look like this
prontera,0,0,0 script rewards 444,{ mes "something"; if(!gepard_int_get("freebies")){ gepard_int_set("freebies",1); mes "here is the rewards"; getitem 502,1; }else{ mes "you already got the freebies rewards"; } close; }
-
sader1992's post in auto delete castle data was marked as the answer
- script reset_castle_data -1,{ OnFri2130: //on Friday 9:30 PM , edit this to what you want. [email protected]$ = ""; //input the guild castle name (map name like "gefg_cas01"). [email protected] = 0; //if the script didn't work , try to change this to a guild id owned by you. for([email protected] = (CD_NONE+1); [email protected] < (CD_MAX-1); [email protected]++){ if([email protected] == CD_GUILD_ID){ setcastledata [email protected]$,[email protected],[email protected]; }else{ setcastledata [email protected]$,[email protected],0; } } end; }
-
sader1992's post in Make cursed flame effect with specialeffect command was marked as the answer
i didn't read the full topic , so i would answer only this question , i don't know if any other question is asked
if you mean like this
it can be done like this
- script ::NPC_UNIQUE_NAME8765643433 444,13,13,{ end; OnInit: hideonnpc strnpcinfo(3); end; OnTouch: specialeffect 696,SELF; end; } prontera,160,127,4 duplicate(NPC_UNIQUE_NAME8765643433) #no1 444,13,13 prontera,160,129,4 duplicate(NPC_UNIQUE_NAME8765643433) #no2 444,13,13 prontera,160,131,4 duplicate(NPC_UNIQUE_NAME8765643433) #no3 444,13,13 prontera,160,133,4 duplicate(NPC_UNIQUE_NAME8765643433) #no4 444,13,13 prontera,160,135,4 duplicate(NPC_UNIQUE_NAME8765643433) #no5 444,13,13 prontera,160,137,4 duplicate(NPC_UNIQUE_NAME8765643433) #no6 444,13,13 prontera,160,139,4 duplicate(NPC_UNIQUE_NAME8765643433) #no7 444,13,13 prontera,160,141,4 duplicate(NPC_UNIQUE_NAME8765643433) #no8 444,13,13 prontera,160,143,4 duplicate(NPC_UNIQUE_NAME8765643433) #no9 444,13,13 prontera,151,127,4 duplicate(NPC_UNIQUE_NAME8765643433) #no11 444,13,13 prontera,151,129,4 duplicate(NPC_UNIQUE_NAME8765643433) #no12 444,13,13 prontera,151,131,4 duplicate(NPC_UNIQUE_NAME8765643433) #no13 444,13,13 prontera,151,133,4 duplicate(NPC_UNIQUE_NAME8765643433) #no14 444,13,13 prontera,151,135,4 duplicate(NPC_UNIQUE_NAME8765643433) #no15 444,13,13 prontera,151,137,4 duplicate(NPC_UNIQUE_NAME8765643433) #no16 444,13,13 prontera,151,139,4 duplicate(NPC_UNIQUE_NAME8765643433) #no17 444,13,13 prontera,151,141,4 duplicate(NPC_UNIQUE_NAME8765643433) #no18 444,13,13 prontera,151,143,4 duplicate(NPC_UNIQUE_NAME8765643433) #no19 444,13,13
-
sader1992's post in @whosell was marked as the answer
try this
/*========================================== * @whosell - List who is vending the item (amount, price, and location). * revamped by VoidLess, original by zephyrus_cr *------------------------------------------*/ ACMD_FUNC(whosell) { char item_name[100]; int item_id = 0, j, count = 0, sat_num = 0; int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine int refine = 0,card_id = 0; bool flag = 1; // place dot on the minimap? struct map_session_data* pl_sd; struct s_mapiterator* iter; unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; struct item_data *item_data; static char atcmd_output[CHAT_SIZE_MAX]; if (!*message) { clif_displaymessage(fd, "Use: @whosell <item_id> or @whosell <name>"); return -1; } if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){ s_type = 1+2+4; } else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){ s_type = 1+4; } else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){ s_type = 2+4; } else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){ s_type = 1+2; } else if (sscanf(message, "[%d]", &card_id) == 1){ s_type = 2; } else if (sscanf(message, "+%d", &refine) == 1){ s_type = 4; } else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){ s_type = 1; } else if (sscanf(message, "%99[^\n]", item_name) == 1){ s_type = 1; if ((item_data = itemdb_searchname(item_name)) == NULL){ clif_displaymessage(fd, "Not found item with this name"); return -1; } item_id = item_data->nameid; } else { clif_displaymessage(fd, "Use: @whosell <item_id> or @whosell <name>"); return -1; } //check card if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){ clif_displaymessage(fd, "Not found a card with than ID"); return -1; } //check item if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){ clif_displaymessage(fd, "Not found an item with than ID"); return -1; } //check refine if(s_type & 4){ if (refine<0 || refine>10){ clif_displaymessage(fd, "Refine out of bounds: 0 - 10"); return -1; } /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){ clif_displaymessage(fd, "Use refine only with weapon or armor"); return -1; }*/ } iter = mapit_getallusers(); for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) { if (pl_sd->vender_id ) { // check if player is vending for (j = 0; j < pl_sd->vend_num; j++) { if ((item_data = itemdb_exists(pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid)) == NULL) continue; if(s_type & 1 && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].nameid != item_id) continue; if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || (pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] != card_id && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] != card_id && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] != card_id && pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] != card_id))) continue; if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine != refine)) continue; if(item_data->type == IT_ARMOR) snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %s[%d] | Price %ud | Amount %d | %s[%d,%d] | %s",pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine ,item_data->jname ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] ,pl_sd->vending[j].value ,pl_sd->vending[j].amount ,mapindex_id2name(pl_sd->mapindex) ,pl_sd->bl.x,pl_sd->bl.y ,pl_sd->message); else if(item_data->type == IT_WEAPON) snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %s[%d,%d,%d,%d] | Price %ud | Amount %d | %s[%d,%d] | %s",pl_sd->cart.u.items_cart[pl_sd->vending[j].index].refine ,item_data->jname ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] ,pl_sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] ,pl_sd->vending[j].value ,pl_sd->vending[j].amount ,mapindex_id2name(pl_sd->mapindex) ,pl_sd->bl.x,pl_sd->bl.y ,pl_sd->message); else snprintf(atcmd_output, CHAT_SIZE_MAX, "%s | Price %ud | Amount %d | %s[%d,%d] | %s",item_data->jname ,pl_sd->vending[j].value ,pl_sd->vending[j].amount ,mapindex_id2name(pl_sd->mapindex) ,pl_sd->bl.x, pl_sd->bl.y ,pl_sd->message); if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value; if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value; clif_displaymessage(fd, atcmd_output); count++; flag = 1; } if (flag && pl_sd->mapindex == sd->mapindex) { clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF); flag = 0; } } } mapit_free(iter); if(count > 0) { snprintf(atcmd_output, CHAT_SIZE_MAX, "================== Found %d entries. ==================", count, MinPrice, MaxPrice); clif_displaymessage(fd, atcmd_output); } else clif_displaymessage(fd, "Nobody is selling it now."); return 0; }