Advertisement
ZoriaRPG

Level Key Script Set for 2.55

Mar 5th, 2019
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. //For 2.55
  2. //Places a leve key on any screen at the coordinates of the ffc
  3. ffc script LKey
  4. {
  5.     const int ID = 100; //get externally as LKey.ID
  6.     void run(int lvl)
  7.     {
  8.         item i = Screen->CreateItem(ID);
  9.         i->X = this-X;
  10.         i->Y = this->Y;
  11.         i->PScript = Game->GetItemScript("LevelKey");
  12.         i->InitD[0] = Clamp(lvl,0,511);
  13.     }
  14. }
  15. //Collect script, set automatically by the ffc
  16. item script LevelKey
  17. {
  18.     void run(int lvl)
  19.     {
  20.         ++Game->LKeys[lvl];
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement