Jump to content

Xynvaroth

Members
  • Posts

    254
  • Joined

  • Last visited

  • Days Won

    3

Community Answers

  1. Xynvaroth's post in OnNPC Kill + Summon monster? was marked as the answer   
    Like already discussed in this area, you should use the monster command and an additional label to be triggered when the monster dies if you only want to trigger the death of a few certain monsters.
    OnNPCKillEvent should only be used if you want a general label which is triggered whenever any monster on the server is killed. You could want to use this, for instance, if you want to count all the monsters a player kills, but not if you want to trigger the death of certain, few monsters.
    The resource difference might not be that noticable for all cases, since we are talking about a very short time duration, but it still exists and if you run many unoptimised scripts, you will eventually notice a different.
  2. Xynvaroth's post in how can i block slave clones in guild map? was marked as the answer   
    In general, the clone( ) command will return the monster unit id which can be used to later kill the clone using unitkill( ).
    That said, you will have to somehow store all the clones' ids which are spawned and as soon as a player enters a gvg map, kill the clones of that player.
    I would recommend you using my Xynvaroth_Array script, because you can create permanent character arrays with it. Everytime someone uses a clone pot, add the clone's id to the array. Then, when a player enters a gvg map - you can use the OnMapLoad event to know when a player enters such a map -, go through the array, kill the clones and reset the array using Xynvaroth_Array_Reset( ).
    You might face two problems with this solution:
    1. The array will contain ids of clones which are already dead, because most clones will have a limited living duration.
    2. The array will grow and grow when a player uses the potions and never goes on a gvg map.
    To solve these issues, you could, for example, always when a player uses a potion and before you save the clone's id, go through all the ids in the array and delete the ids of clones which are already dead using Xynvaroth_Delete( ).
  3. Xynvaroth's post in Create List out of DB was marked as the answer   
    1. Delete the arrays you will use for query_sql( ).
    2. Use query_sql( ) to get the datasets (order the result by `Points`).
    3. Loop through the datasets using for( ).
    4. For each dataset, select the character names from the `char` table and display both the names and the points.
    This will only work if you have less than 128 entries in the top list.
    See this suggestion if you want more than 128 entries.
  4. Xynvaroth's post in (NPC): (invisible/not on a map) was marked as the answer   
    The warnings are displayed, because integer values are put into string variables and the commands used in this script require integer values.
    Delete all the dollar symbols behind the variable names.
    For example, change
    set .@item$,501;toset .@item,501;
  5. Xynvaroth's post in Freebies reward problem was marked as the answer   
    You're not using the getitem( ) function properly.
    For example, changegetitem 13758,1,969,20,1108,1,2104,1,4043,4;togetitem 13758,1; getitem 969,20; getitem 1108,1; getitem 2104,1; getitem 4043,4;
  6. Xynvaroth's post in Headgear Disguising was marked as the answer   
    Are you looking for something like that: release-script.googlecode.com/svn/Premium disguise headgear.txt (sorry, the tag doesn't seem to properly show the link) ?
    If yes, then the part where the look is actually changed is this:
    OnPCLoginEvent: if (hastop) changelook 4,premiumtop; if (hasmid) changelook 5,premiummid; if (haslow) changelook 3,premiumlow; end; The NPC will let the player select the headgar they would like to see on his or her character and saves the headgear's view id into the premiumtop, premiummid or the premiumlow variable. In addition, the variable hastop, hasmid or haslow will contain 1 if a player has saved a disguise headgar and 0 if he or she hasn't (which I would not suggest, because you could just check whether premiumtop, premiumid or premiumlon is set or not without needing an other variable).Whenever a player logs in, it will then change the look of the player to the earlier saved view id.
×
×
  • Create New...