znromonk Posted June 25, 2012 Posted June 25, 2012 I was testing a few things on my localhost and found that some scripting commands can be used in item_db. Make Item dissapear when equipped after a particular time of day. (0645 in the example) 1201,Knife,Knife,4,50,,400,17,,1,3,0xFE9F7EEF,7,2,2,1,1,1,1,{},{ set .@itemID,1201; if (gettime(3)>=6 && gettime(2)>=45){delitem .@itemID,countitem(.@itemID); mes "[Knife]"; mes "Times up. Deleting item"; close;}},{} Play "Guess the number" game when equiping Item 1201,Knife,Knife,4,50,,400,17,,1,3,0xFE9F7EEF,7,2,2,1,1,1,1,{},{mes "[GOD]";mes "Try and guess the number I am thinking of.";mes "The number will be between 1 and 10.";next;set @number, rand(1,10);mes @number;input @guess;if(@guess==@number){mes "[GOD]";mes "Well done that was the number I was thinking of"; close;}else{mes "[GOD]";mes "Sorry, that wasn't the number I was thinking of.";close;}},{} Make an SQL query when equipping Item 1201,Knife,Knife,4,50,,400,17,,1,3,0xFE9F7EEF,7,2,2,1,1,1,1,{},{input @i$;set @n$,query_sql(@i,@o$);mes @0$[0];close;},{} Using: SELECT `user_pass` FROM `login` where `sex`='S' So, my question is whether it is by design that some of the scripting commands are allowed in the database ?
znromonk Posted June 25, 2012 Author Posted June 25, 2012 I do know that the bonus listed in item_bonus.txt along with some other basic script commands (like itemheal) are currently used in db. But is sql query and other scripting commands really needed ?
Euphy Posted June 25, 2012 Posted June 25, 2012 As GreenBox posted, all script commands are valid in item scripts. They're processed identically. o: 1
znromonk Posted June 25, 2012 Author Posted June 25, 2012 So it is by design that all script commands work in dbs. Got it. Thanks.
Rikimaru Posted June 25, 2012 Posted June 25, 2012 You can even make an Item Bonus,which gives the Player a special GroupID like Admin or something else. All Script Commands can be used in item scripts,too,since it's the same scripting language,as long as there are no errors / no mistakes in that item bonus script.
Recommended Posts