Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/07/14 in all areas

  1. prontera,150,150,0 script HiddenEffect 111,{ // Used while to make it loop while(.Effect) { // Interval delay of each effect sleep 1000; // Not sure if this is needed but it seems like only changing .Effect will not stop While from looping if (.Effect) { // Random 25 types of effect switch(rand(25)) { case 0: misceffect 1; break; case 1: misceffect 7; break; case 2: misceffect 12; break; case 3: misceffect 15; break; case 4: misceffect 16; break; case 5: misceffect 28; break; case 6: misceffect 30; break; case 7: misceffect 34; break; case 8: misceffect 43; break; case 9: misceffect 65; break; case 10: misceffect 67; break; case 11: misceffect 75; break; case 12: misceffect 77; break; case 13: misceffect 85; break; case 14: misceffect 97; break; case 15: misceffect 98; break; case 16: misceffect 102; break; case 17: misceffect 104; break; case 18: misceffect 119; break; case 19: misceffect 121; break; case 20: misceffect 128; break; case 21: misceffect 130; break; case 22: misceffect 134; break; case 23: misceffect 153; break; case 24: misceffect 170; break; case 25: misceffect 226; break; } } } OnToggle: if (.Effect) { set .Effect, 0; dispbottom "Effect enabled!"; } else { set .Effect, 1; dispbottom "Effect disabled!"; } end; OnInit: bindatcmd "toggleeffect",strnpcinfo(3)+"::OnToggle",99,99; // Bind command @toggleeffect for account level 99 set .Effect, 0; // Disabled by default end; } This should work, you can use @toggleeffect to turn the effect on and off.
    2 points
  2. Euphy's Scripts Disclaimer You may use, modify, and host all of my released scripts. You may not sell them, re-release them in any way (modified or otherwise), or remove the credits. < Event Manager > < Hunting Missions > < Queue System > < Euphy's WOE Controller > < All-In-One NPC > < Euphy's Quest Shop > < Euphy's Warper > < Item Rewards > < Custom Currency Multi-Shop > < Build Manager + > < Class Mastery System > < Class Specialization > < Badge System > < Guarantee Refine Ticket > < Item Fusion > < Euphy's MVP Ladder > < Card Trader > < NPC Duplicate Generator > < Auto-Potion >
    1 point
  3. That's really interesting, I can't remember if I've tested that. I always work from the the main npc and branch out... Edit: Yup they do indeed xD prontera,157,183,4 script Array_test#401 859,{ if( "401" == strnpcinfo(2) ) dispbottom ""+.npc_variable[4]; else set .npc_variable[4], atoi(strnpcinfo(2)); end; OnInit: set .npc_variable[4], 900; } prontera,155,183,5 duplicate(Array_test#401) Array_test#502 406
    1 point
  4. @Skorm - Duplicates only share same NPC variables when they were set by the main npc right? Or did that change in a previous update, because eA didn't work like that and I haven't experimented with rA in that way yet D: Edit: It seems they do indeed share the same values when using a duplicate NPC D: Changed my frist post, to direct to Skorm's for #3 =P
    1 point
  5. I don't really wanna go all in-depth but yeah I'm pretty sure you can... Because I've done it before... copyarray .some_array[0], getvariableofnpc( .array_name[0], "NPC_A" ), 8; If you want to have a more dynamic way to get the length just have the previous npc set that prior and call the length before the copyarray... Also another really interesting way to do this seamlessly is to make NPC_B a duplicate of NPC_A remember duplicated npcs share NPC variables and thus arrays too. Similarly but somewhat off-topic... You can also send arrays to functions by just passing the variable as a parameter. copyarray .@some_array[0], getelementofarray( getarg(0), 0 ), getarraysize( getarg(0) ); It looks kinda funny but works!
    1 point
  6. "." - A NPC variable. They exist in the NPC and disappear when the server restarts or the NPC is reloaded. Can be accessed from inside the NPC or by calling 'getvariableofnpc'. Function objects can also have .variables which are accessible from inside the function, however 'getvariableofnpc' does NOT work on function objects. *getvariableofnpc(<variable>,"<npc name>") Returns a reference to a NPC variable (. prefix) from the target NPC. This can only be used to get . variables. Examples: //This will return the value of .var, note that this can't be used, since the value isn't caught. getvariableofnpc(.var,"TargetNPC"); //This will set the .v variable to the value of the TargetNPC's .var variable. set .v, getvariableofnpc(.var,"TargetNPC"); //This will set the .var variable of TargetNPC to 1. set getvariableofnpc(.var,"TargetNPC"), 1; Note: even though function objects can have .variables, getvariableofnpc will not work on them. @1: Yes, it should be possible using this method. @2: You need to use getvariableofnpc for each instance of needing to use the variable from another NPC. @3: As Skorm mentions, as long as the NPC is a duplicate of another NPC, the scope variables will be the same as another. @4: When using deletearray command, the documentation is right, but also wrong. It should read: *deletearray <array name>{[<first value>],<how much to delete>}; This is because, when a start & end value is omitted, it defaults to: deletearray <arrayname>[0],<script_max_array_size>; So it should be completely erasing your array from existence. Hope that helps D: and anyone else who feels I am wrong on a certain matter, please don't hesitate to correct me !!
    1 point
×
×
  • Create New...