Advertisement
ZoriaRPG

Run Arbitrary Script

May 29th, 2019
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. //! Runs an arbitrary item script 'name' on a constant  item named 'hotscript'.
  2. //! Returns the script ID.
  3. int RunAScript(int name)
  4. {
  5.      itemdata id = Game->LoadItemData(Game->GetItem("hotscript"));
  6.      int script_number = Game->GetItemScript(name);
  7.      id->Script = script_number;
  8.      id->RunScript();
  9.      return script_number;
  10. }
  11.  
  12. //! Runs an arbitrary item script.
  13. //! Itemname is the name of the item used to run script scriptname.
  14. //! Returns the script number.
  15. int RunAScript(int scriptname, int itemname)
  16. {
  17.      itemdata id = Game->LoadItemData(Game->GetItem("hotscript"));
  18.      int script_number = Game->GetItemScript(scriptname);
  19.      id->Script = script_number;
  20.      id->RunScript();
  21.      return script_number;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement