Created
November 10, 2016 11:04
-
-
Save cydh/ecac2363cf44a9021a81cd2bced34dd8 to your computer and use it in GitHub Desktop.
Sample NPC to add Random Option for Crimson Weapons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prontera,109,187,3 script Crimson Weapon Enchanter 4_F_KAFRA3,{ | |
mes "[Kafra]"; | |
.@i = getequipid(EQI_HAND_R); | |
if (.@i == -1) { | |
mes "You don't hold any weapon!"; | |
close; | |
} | |
mes "What element you want to endow?"; | |
next; | |
.@menu$ = ""; | |
for (.@i = 0; .@i < getarraysize(.opt$); .@i++) { | |
.@menu$ = .@menu$+""+.opt$[.@i]+":"; | |
} | |
.@menu$ = .@menu$+"Close"; | |
.@sel = select(.@menu$)-1; | |
if (.@sel == .@i) | |
close; | |
mes "You choose "+.opt$[.@sel]; | |
setrandomoption(EQI_HAND_R,0,.opt[.@sel],0,0); | |
mes "Done"; | |
close; | |
OnInit: | |
.opt$[0] = "Neutral"; .opt[0] = RDMOPT_WEAPON_ATTR_NOTHING; | |
.opt$[1] = "Water"; .opt[1] = RDMOPT_WEAPON_ATTR_WATER; | |
.opt$[2] = "Earth"; .opt[2] = RDMOPT_WEAPON_ATTR_GROUND; | |
.opt$[3] = "Fire"; .opt[3] = RDMOPT_WEAPON_ATTR_FIRE; | |
.opt$[4] = "Wind"; .opt[4] = RDMOPT_WEAPON_ATTR_WIND; | |
.opt$[5] = "Poison"; .opt[5] = RDMOPT_WEAPON_ATTR_POISON; | |
.opt$[6] = "Holy"; .opt[6] = RDMOPT_WEAPON_ATTR_SAINT; | |
.opt$[7] = "Darkness"; .opt[7] = RDMOPT_WEAPON_ATTR_DARKNESS; | |
.opt$[8] = "Ghost"; .opt[8] = RDMOPT_WEAPON_ATTR_TELEKINESIS; | |
.opt$[9] = "Unded"; .opt[9] = RDMOPT_WEAPON_ATTR_UNDEAD; | |
end; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment