@Sephiroth91their is a script command that's special for commands defined by bindatcmd.
*useatcmd "<command>";
This command will execute a script-bound atcommand for the attached RID. If the
supplied command is not bound to any script, this command will act like 'atcommand'
and attempt to execute a source-defined command.
Rynbef~
@powkda
Some small suggestions
if u only want to know if player don't have one of an item u better change from:
if(countitem(31000)<1)
To:
if(!countitem(31000))
If u just need the label noanel once. U should better put the code directly to the if statement. It will be better than goto a label u only need once.
U don't need to close; and end; the script. Close end the dialog (mes etc). End stops the script. It's as example used if no dialog is open. If u want to close the dialog but u want to do something like getitem, delitem or else where u need to keep player attached u can use close2. It will close the dialog normally but the script do stuff in background. Than u need to end the script afterwards.
On switch case u can use break; to jump directly to the code after the switch. It will ignores the other cases.
This should works for u:
case 1:
if(!countitem(31000))goto noanel;
getinventorylist;
for(set .@i,0; .@i<@inventorylist_count; .@i++){
if(@inventorylist_id[.@i] == 31000 && !@inventorylist_equip[.@i]){
delitem @inventorylist_id[.@i],1;
getitem 30001,5;
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Aqui está a sua recompensa.";
close;
} else if(.@i==inventorylist_count){
//they only have the equipped item
close;
} else continue;
}
end;
Feel free to PM me if u need help. I'm already willing to help.
Rynbef~
Idea:
add to *getunittype() one (or two) new types BL_CMD/BL_SCRIPTCMD to check if monster was killed by script-/ or atcommand.
A new pre defined variable of type int *killedmid it contains the ID of the mob who was killed(not the unique game mob ID *GID). Will be empty(0) if no mob was killed of course.
//I don't know if there is any other way to check if mob was killed by script and get the MOB ID or cast GID to MOB ID. If monster spawn by script command with own unique event label its not possible to check if the mob was killed by command (script/at) in my opinion. Only we know the ID.
Maybe I'm lost but tried/searched everything.
What do you think about?
Rynbef~
@HerbertsidyThere is a DOTA PVP Ladder by @AnnieRurubut it's a few years ago since updated. But it should be exactly what ur looking for.
https://herc.ws/board/topic/18871-dota-pvp-ladder/?tab=comments#comment-97841
EDIT: @AnnieRuruupdated it at 20th of december 2020. I've updated link above.
Rynbef~
@ErossU can find the files for this at: data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/basic_interface/
If u mean the equipment costume window exactly u can find it here: data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/basic_interface/equipwin_costume.bmp
Rynbef~
@Sephiroth91
1st suggestion change:
bindatcmd("dailyreward",strnpcinfo(3)+"::OnLoginCmnd");
To:
bindatcmd("dailyreward",strnpcinfo(3)+"::OnLoginCmnd",0,0);
2nd suggestion: U've also tested with my function? This function attach the player and use the command.
Rynbef~
@Erossmaybe it use the twitter support of newer clients. Or a WebView. Idk if it is implemented yet if not it's could be an extension injected as dll file in the client.
In my opinion one of the hackshield does support WebView but idk which one.
Rynbef~
@Sephiroth91Try to change:
bindatcmd("dailyreward",strnpcinfo(3)+"::OnLoginCmnd",0,99);
To:
bindatcmd("dailyreward",strnpcinfo(3)+"::OnLoginCmnd");
Or if it won't work:
bindatcmd("dailyreward","LOGIN::OnLoginCmnd");
Rynbef~
@acaciomilkI've optimized u're script a bit.
NOTE: I can't test it yet but it's should work.
Suggestions: Use close2; to close the dialog and afterwards u can kick player or else cause he will keep attached to the script. Then end; the script.
I can recommend to use switch(getgmlevel()) instead of calling so much script labels.
U readparam before checking it and call it in the if statement again. This makes no sense if u don't store it in an array or variable.
On the event labels u used close; but there was no dialog therefore its causes errors. U need to end; the script.
Don't declair labels inside an if statement. U're own labels needs to declaired like the default labels "OnInit" or "OnPCLoginEvent".
The close2; is better if u give/delete items or set variables cause auto-close can be abused.
Seguranca_Aviso optimized.txt
Rynbef~
Change the slot amount at the item_db_equip.yml at ur server and the visual slots at the iteminfo.lub located in ur ragnarok folder. Notice that u've to patch the iteminfo.lub to every user so they can see it too.
Rynbef~
@Sephiroth91Try to add this above to ur item:
callfunc "REWARDCMD",getcharid(3);
And use this modified version (not tested):
DailyReward_changed.txt
Rynbef~
@Akbaremaybe remove "disable_items;" after:
mes "Requirements:";
Normally it blocks changing equipment while talking to npc but it could be possible that it couldn't count ur item because it is an equipment item.
Rynbef~
@Erossmaybe u used the wrong file. But I've added an if-statement to check if mob class is boss too.
ChangedMob v2.cpp
@Erossdoes it solved ur request?
Rynbef~
@ErossPls let us know this at the begin of ur request than it will be much easier to help u.
In ur case it begin at line 4134. I've already changed everything and attached the changed file.
Changed Mob.cpp
Rynbef~
@Sephiroth91Rename the Label by replacing all OnLoginCmnd to OnCommandLogin. Than call cmdothernpc "LOGIN","Login";
Don't forget to replace every label calls like Bindcommand and else.
Rynbef~
@Sephiroth91Maybe add this on ur item:
cmdothernpc "<npc name>","<command>"; This is simply "donpcevent <npc name>::OnCommand<command>". It is an approximation of official server script language's 'cmdothernpc'. Returns true if the command was executed on the other NPC successfully, false if not
Rynbef~