Advertisement
ZoriaRPG

AutoGhost Ten Script Type Defs

Nov 19th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.26 KB | None | 0 0
  1. //Ten Script Defences for a Ghosted Enemy
  2. //v0.2.1
  3.  
  4. ffc script ScriptDefsGhost{
  5.     void run(){
  6.         int Defs[18];
  7.         //Store normal ghost defs here.
  8.         int ScriptDefs[10];
  9.         //store script defs here.
  10.        
  11.        
  12.     while(true){
  13.         Waitframe();
  14.     }
  15.    
  16.     void SetScriptDefs(ffc f, npc n int ScriptDefs){
  17.         int def;
  18.         for ( int q = 1; q <= Screen->NumLWeapons(); q++ ) {
  19.             lweapon l = Screen->LoadLWeapon(q);
  20.             if ( l->ID >= 31 && l->ID <= 40 ) {
  21.                 if ( Collision(f,l) || Collision (n,l) ) {
  22.                     def = ScriptDefs[l->ID - 31];
  23.                     n->Defense[17] = def;
  24.                 }
  25.             }
  26.         }
  27.     }
  28.    
  29.  
  30.     void _SetGhostScriptDef(npc n, ffc f, int script_id, int ScriptDefs){
  31.         for ( int q = 1; q <= Screen->NumLWeaponsOf(script_id) ) {
  32.             lweapon l = Screen->LoadLWeapon(q);
  33.                 if ( Collision(f,l) || Collision(n,l) ) n->Defense[17] = ScriptDefs[script_id - 31];
  34.         }
  35.     }
  36.    
  37.     void SetGhostScriptDef(ffc f, npc n, int script_id, int def_type){
  38.         for ( int q = 1; q <= Screen->NumLWeaponsOf(script_id) ) {
  39.             lweapon l = Screen->LoadLWeapon(q);
  40.                 if ( Collision(f,l) || Collision(n,l) ) n->Defense[17] = def_type;
  41.         }
  42.     }
  43.  
  44.     void CleanUpScriptDefs(ffc f, npc n, int Defs){
  45.         n->Defense[17] = Defs[17];
  46.         //f->Something if we want to use a ghost property here.
  47.         //or call a ghost function
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement