ZoriaRPG icon

Run Arbitrary Script

ZoriaRPG | PRO | 05/30/19 04:59:03 AM UTC | 0 ⭐ | 717 👁️ | Never ⏰ | []
C++ |

730 B

|

None

|

0 👍

/

0 👎

//! Runs an arbitrary item script 'name' on a constant  item named 'hotscript'.
//! Returns the script ID.
int RunAScript(int name)
{
     itemdata id = Game->LoadItemData(Game->GetItem("hotscript"));
     int script_number = Game->GetItemScript(name);
     id->Script = script_number;
     id->RunScript();
     return script_number;
}
 
//! Runs an arbitrary item script.
//! Itemname is the name of the item used to run script scriptname.
//! Returns the script number. 
int RunAScript(int scriptname, int itemname)
{
     itemdata id = Game->LoadItemData(Game->GetItem("hotscript"));
     int script_number = Game->GetItemScript(scriptname);
     id->Script = script_number;
     id->RunScript();
     return script_number;
}

Comments