ZoriaRPG

Run Arbitrary Item Script

Mar 3rd, 2019
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const int I_SCRIPTRUNNER = 511;
  2.  
  3. //Usage: RunArbitraryItemScript("MyScript");
  4. void RunArbitraryItemScript(int scriptname, untyped args)
  5. {
  6.     itemdata id = Game->LoadItemData(I_SCRIPTRUNNER);
  7.     id->Script = Game->GetItemScript(scriptname);
  8.     for ( int q = 0; q < 8; ++q ) id->InitD[q] = args[q];
  9.     id->RunScript();
  10. }
RAW Paste Data