Jump to content

Photo

Ice rod


  • Please log in to reply
8 replies to this topic

#1 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 03 January 2018 - 12:29 PM

Hi

 

I am looking for one item so is there someone who has an ice rod script that frezzes water and enemies 

and would like to share it?

 

 

Edit: Thanks to Ywkls i have it now....


Edited by judasrising, 05 January 2018 - 01:11 AM.

  • ywkls likes this

#2 Aefre

Aefre

    artist guy

  • Members
  • Real Name:Jarik
  • Location:Oregon

Posted 06 February 2018 - 03:43 PM

Could I get this aswell...?



#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 06 February 2018 - 06:10 PM

Could I get this aswell...?


I believe that JudasRising used the version included in stdaweapons.zh.

I have my own version, but it is not easy to set up, or 'portable'.

#4 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 06 February 2018 - 08:02 PM

Could I get this aswell...?


The script i use for it requires an header file by Ywkls lweapons.zh and some other header files.


Edited by judasrising, 07 February 2018 - 12:50 AM.

  • ywkls likes this

#5 ywkls

ywkls

    Master

  • Members

Posted 07 February 2018 - 12:58 AM

This was the script I shared with judasrising.

item script Winter_Wand{
    void run(int dummy, int Cost){
        lweapon wand;
        wand = FireLWeapon(LW_SCRIPT1,Link->X+InFrontX(Link->Dir,2), Link->Y+InFrontY(Link->Dir,2),
                            __DirtoRad(Link->Dir), 0, 10, SPR_ROD, SFX_SWORD, 0);
        SetLWeaponLifespan(wand,LWL_TIMER,10);
        SetLWeaponDeathEffect(wand,LWD_VANISH,0);
        Link->Action = LA_ATTACKING;
        if(NumLWeaponsOf(LW_MAGIC)==0 && Link->MP>=Cost){
            Game->PlaySound(ICE_HEART_SFX);
            Link->MP-=Cost;
            int Args[8];
            NewFFCScript(ICE_HEART_SCRIPT, Args);
        }
    }
}
const int ICE_HEART_SCRIPT =21;//Script slot used by the ffc.
const int SPR_ROD =134;//Weapon sprite used by the rod.

const int ICE_HEART_SFX =44;//Sound ice beam makes.
const int ICE_WALK_COMBO = 29443;//Ice combo you can walk on.
const int ICE_PROJECTILE_COMBO = 29441;//Invisible combo.
const int ICE_HEART_SPEED = 1;//Speed of Ice beam.
const int MAX_ICE_PLATFORM_TIME = 600;//Time ice platform exists 600
const int ICE_HEART_CSET = 0;//Cset for Ice beam.
const int ICE_BLOCK_CSET = 7;//Cset for ice block.
const int CF_ICE_HEART_SECRET = 99;//Combo flag triggered by ice beam.
const int CF_ICE_HEART_SWITCH = 98;//Combo flag changed by ice beam.

ffc script IceHeart{
    void run(){
        //Set up ffc.
        this->Data = ICE_PROJECTILE_COMBO;
        this->X = Link->X+InFrontX(Link->Dir,2);
        this->Y = Link->Y+InFrontY(Link->Dir,2);
        this->CSet = ICE_HEART_CSET;
        bool impact = false;//Tests whether an enemy or freezable combo has been hit.
        bool hitwall = false;//Tests whether projectile has hit an object it can't pass thru.
        int impactX;
        int impactY;
        int Ice_Timer;//Used internally by ffc to track how long ice combo has existed.
        int SavedCombo[176];
        int SavedType[176];
        int SavedCSet[176];
        int SavedLoc[176];
        int i;//Iterative variable.
        lweapon magic= FireLWeapon(LW_MAGIC,Link->X+InFrontX(Link->Dir,2),
                                    Link->Y+InFrontY(Link->Dir,2),__DirtoRad(Link->Dir),
                                    300, 10, SPR_MAGIC, SFX_WAND, LWF_STUNS_ENEMIES);
        SetLWeaponLifespan(magic,LWL_EDGE,0);
        magic->Misc[LW_ZH_I_FLAGS_2]|=LWF_LEVEL_4;
        //Set array for changed combos to negative one so we know those haven't been changed.
        for(i = 0; i < 176; i++)
            SavedLoc[i]=-1;
        //You haven't hit an enemy, or an impassable barrier and the projectile is still on the screen.
        while(!impact && this->X>0
                && this->Y>0 && this->X<256
                && this->Y<170 && !hitwall
                && magic->isValid()){
            //Adjust the position of the ffc every frame, based on the direction Link was facing when he fired it.
            this->X = magic->X;
            this->Y = magic->Y;
            //Scan all combos.
            for(i = 0; i < 176; i++){
                //If within 8 pixels of any combo...
                if(Abs(this->X-ComboX(i))<8 && Abs(this->Y-ComboY(i))<8){
                    //Does this have the flag to trigger secrets?
                    if(ComboFI(i,CF_ICE_HEART_SECRET)){
                        //Trigger Secrets.
                        Screen->TriggerSecrets();
                        Screen->State[ST_SECRET] = true;
                        Game->PlaySound(SFX_SECRET);
                    }
                    if(ComboFI(i,CF_ICE_HEART_SWITCH)){
                        Screen->ComboD[i]++;
                        Quit();
                    }
                    //Would this block the projectile?
                    if((Screen->ComboT[i]==CT_BLOCKALL
                        ||Screen->ComboT[i]==CT_BLOCKMAGIC))
                        hitwall = true;
                    //Is this combo water or script type 1? To freeze lava.
                    else if(Screen->ComboT[i]==CT_WATER
                            ||Screen->ComboT[i]==CT_SCRIPT1){
                        //Save the data for the combo we've hit.
                        SavedCSet[i] = Screen->ComboC[i];
                        SavedType[i] = Screen->ComboT[i];
                        SavedCombo[i]= Screen->ComboD[i];
                        //Change the combo tp walkable, type none. Done to keep block from destroying the floor.
                        ChangeCombo(i,ICE_WALK_COMBO,ICE_BLOCK_CSET,CT_NONE);
                        //Save the location of the changed combo.
                        if(Screen->ComboD[i]!=SavedCombo[i])SavedLoc[i]=i;
                        impactX = this->X;
                        impactY = this->Y;
                        //Create the timer.
                        impact = true;
                    }
                }
            }
            Waitframe();
        }
        //You've hit an enemy or a freezable combo.
        if(impact){
            //Position the ffc.
            this->X = impactX;
            this->Y = impactY;
            //Set up timer.
            Ice_Timer = MAX_ICE_PLATFORM_TIME;
            //Draws the ffc over the enemy.
            this->Flags[FFCF_OVERLAY] = true;
            //Make it transparent.
            this->Flags[FFCF_TRANS] = true;  
            this->Data = GH_INVISIBLE_COMBO;
        }
        //Original Platform script by Moosh. Modified by me.
        while(Ice_Timer>0){
             Ice_Timer--;
             Waitframe();
          }
          //Check to see which combos were changed and change them back.
          for(i = 0; i < 176; i++){
                if(SavedLoc[i]!=-1)
                    ChangeCombo(i,SavedCombo[i],SavedCSet[i],SavedType[i]);
          }
          //Eliminate the ffc.
          this->Data = 0;
    }
}
 
//A function to change the current combo at a location.
//Changes id, cset and type.
 
//D0- Location to change.
//D1- Combo Id to change to.
//D2- Combo Cset to change to.
//D3- Combo Type to change to.
 
//void ChangeCombo(int loc, int comboid, int cset, int type){
//    if(comboid>-1)Screen->ComboD[loc] = comboid;
//    if(cset>-1)Screen->ComboC[loc]= cset;
//    if(type>-1)Screen->ComboT[loc] = type;
//}

ChangeCombo is only commented out because it's part of LWeapons.zh. You can find a link to the download page with the latest version of that in my signature.

 

LWeapons.zh requires std.zh, stdExtra.zh, ghost.zh, string.zh and ffcscript.zh to run. I had an extensive tutorial as part of last year's PureZC Expo on setting it up and using it if you need it.


Edited by ywkls, 07 February 2018 - 01:05 AM.

  • judasrising and SparksTheUnicorn like this

#6 SaijeNode

SaijeNode

    Newbie

  • Members

Posted 15 March 2018 - 07:07 PM

Awesome Script ywkls !  do you still have that tutorial for setting it up?

also I been trying to set up a new enemy weapon for my Ice Wizzrobe mob.  do you know how to do that? 



 

This was the script I shared with judasrising.

item script Winter_Wand{
    void run(int dummy, int Cost){
        lweapon wand;
        wand = FireLWeapon(LW_SCRIPT1,Link->X+InFrontX(Link->Dir,2), Link->Y+InFrontY(Link->Dir,2),
                            __DirtoRad(Link->Dir), 0, 10, SPR_ROD, SFX_SWORD, 0);
        SetLWeaponLifespan(wand,LWL_TIMER,10);
        SetLWeaponDeathEffect(wand,LWD_VANISH,0);
        Link->Action = LA_ATTACKING;
        if(NumLWeaponsOf(LW_MAGIC)==0 && Link->MP>=Cost){
            Game->PlaySound(ICE_HEART_SFX);
            Link->MP-=Cost;
            int Args[8];
            NewFFCScript(ICE_HEART_SCRIPT, Args);
        }
    }
}
const int ICE_HEART_SCRIPT =21;//Script slot used by the ffc.
const int SPR_ROD =134;//Weapon sprite used by the rod.

const int ICE_HEART_SFX =44;//Sound ice beam makes.
const int ICE_WALK_COMBO = 29443;//Ice combo you can walk on.
const int ICE_PROJECTILE_COMBO = 29441;//Invisible combo.
const int ICE_HEART_SPEED = 1;//Speed of Ice beam.
const int MAX_ICE_PLATFORM_TIME = 600;//Time ice platform exists 600
const int ICE_HEART_CSET = 0;//Cset for Ice beam.
const int ICE_BLOCK_CSET = 7;//Cset for ice block.
const int CF_ICE_HEART_SECRET = 99;//Combo flag triggered by ice beam.
const int CF_ICE_HEART_SWITCH = 98;//Combo flag changed by ice beam.

ffc script IceHeart{
    void run(){
        //Set up ffc.
        this->Data = ICE_PROJECTILE_COMBO;
        this->X = Link->X+InFrontX(Link->Dir,2);
        this->Y = Link->Y+InFrontY(Link->Dir,2);
        this->CSet = ICE_HEART_CSET;
        bool impact = false;//Tests whether an enemy or freezable combo has been hit.
        bool hitwall = false;//Tests whether projectile has hit an object it can't pass thru.
        int impactX;
        int impactY;
        int Ice_Timer;//Used internally by ffc to track how long ice combo has existed.
        int SavedCombo[176];
        int SavedType[176];
        int SavedCSet[176];
        int SavedLoc[176];
        int i;//Iterative variable.
        lweapon magic= FireLWeapon(LW_MAGIC,Link->X+InFrontX(Link->Dir,2),
                                    Link->Y+InFrontY(Link->Dir,2),__DirtoRad(Link->Dir),
                                    300, 10, SPR_MAGIC, SFX_WAND, LWF_STUNS_ENEMIES);
        SetLWeaponLifespan(magic,LWL_EDGE,0);
        magic->Misc[LW_ZH_I_FLAGS_2]|=LWF_LEVEL_4;
        //Set array for changed combos to negative one so we know those haven't been changed.
        for(i = 0; i < 176; i++)
            SavedLoc[i]=-1;
        //You haven't hit an enemy, or an impassable barrier and the projectile is still on the screen.
        while(!impact && this->X>0
                && this->Y>0 && this->X<256
                && this->Y<170 && !hitwall
                && magic->isValid()){
            //Adjust the position of the ffc every frame, based on the direction Link was facing when he fired it.
            this->X = magic->X;
            this->Y = magic->Y;
            //Scan all combos.
            for(i = 0; i < 176; i++){
                //If within 8 pixels of any combo...
                if(Abs(this->X-ComboX(i))<8 && Abs(this->Y-ComboY(i))<8){
                    //Does this have the flag to trigger secrets?
                    if(ComboFI(i,CF_ICE_HEART_SECRET)){
                        //Trigger Secrets.
                        Screen->TriggerSecrets();
                        Screen->State[ST_SECRET] = true;
                        Game->PlaySound(SFX_SECRET);
                    }
                    if(ComboFI(i,CF_ICE_HEART_SWITCH)){
                        Screen->ComboD[i]++;
                        Quit();
                    }
                    //Would this block the projectile?
                    if((Screen->ComboT[i]==CT_BLOCKALL
                        ||Screen->ComboT[i]==CT_BLOCKMAGIC))
                        hitwall = true;
                    //Is this combo water or script type 1? To freeze lava.
                    else if(Screen->ComboT[i]==CT_WATER
                            ||Screen->ComboT[i]==CT_SCRIPT1){
                        //Save the data for the combo we've hit.
                        SavedCSet[i] = Screen->ComboC[i];
                        SavedType[i] = Screen->ComboT[i];
                        SavedCombo[i]= Screen->ComboD[i];
                        //Change the combo tp walkable, type none. Done to keep block from destroying the floor.
                        ChangeCombo(i,ICE_WALK_COMBO,ICE_BLOCK_CSET,CT_NONE);
                        //Save the location of the changed combo.
                        if(Screen->ComboD[i]!=SavedCombo[i])SavedLoc[i]=i;
                        impactX = this->X;
                        impactY = this->Y;
                        //Create the timer.
                        impact = true;
                    }
                }
            }
            Waitframe();
        }
        //You've hit an enemy or a freezable combo.
        if(impact){
            //Position the ffc.
            this->X = impactX;
            this->Y = impactY;
            //Set up timer.
            Ice_Timer = MAX_ICE_PLATFORM_TIME;
            //Draws the ffc over the enemy.
            this->Flags[FFCF_OVERLAY] = true;
            //Make it transparent.
            this->Flags[FFCF_TRANS] = true;  
            this->Data = GH_INVISIBLE_COMBO;
        }
        //Original Platform script by Moosh. Modified by me.
        while(Ice_Timer>0){
             Ice_Timer--;
             Waitframe();
          }
          //Check to see which combos were changed and change them back.
          for(i = 0; i < 176; i++){
                if(SavedLoc[i]!=-1)
                    ChangeCombo(i,SavedCombo[i],SavedCSet[i],SavedType[i]);
          }
          //Eliminate the ffc.
          this->Data = 0;
    }
}
 
//A function to change the current combo at a location.
//Changes id, cset and type.
 
//D0- Location to change.
//D1- Combo Id to change to.
//D2- Combo Cset to change to.
//D3- Combo Type to change to.
 
//void ChangeCombo(int loc, int comboid, int cset, int type){
//    if(comboid>-1)Screen->ComboD[loc] = comboid;
//    if(cset>-1)Screen->ComboC[loc]= cset;
//    if(type>-1)Screen->ComboT[loc] = type;
//}

ChangeCombo is only commented out because it's part of LWeapons.zh. You can find a link to the download page with the latest version of that in my signature.

 

LWeapons.zh requires std.zh, stdExtra.zh, ghost.zh, string.zh and ffcscript.zh to run. I had an extensive tutorial as part of last year's PureZC Expo on setting it up and using it if you need it.



#7 ywkls

ywkls

    Master

  • Members

Posted 15 March 2018 - 08:35 PM

Awesome Script ywkls !  do you still have that tutorial for setting it up?

also I been trying to set up a new enemy weapon for my Ice Wizzrobe mob.  do you know how to do that?


I do, as it so happens.
 
LWeapons.zh Tutorial

 

I should note that this is designed to work against enemies rather than for them.

Also, I've had limited success with changing their CSet properly.

 

If you need further help, just let me know.


  • SparksTheUnicorn likes this

#8 SaijeNode

SaijeNode

    Newbie

  • Members

Posted 15 March 2018 - 10:45 PM

I cant seem to find string.zh or stdextra.zh anywhere to download


man it seems pretty complicated to set up. I keep getting errors.


it keeps telling me constants in std.zh are already being used, so i comment them out, but then it says a ton more constants are being used in ghost.zh



#9 ywkls

ywkls

    Master

  • Members

Posted 15 March 2018 - 11:43 PM

I cant seem to find string.zh or stdextra.zh anywhere to download


man it seems pretty complicated to set up. I keep getting errors.


it keeps telling me constants in std.zh are already being used, so i comment them out, but then it says a ton more constants are being used in ghost.zh

 

You may already be importing them elsewhere. Trying commenting out these lines in LWeapons.zh

import "std.zh"
import "ghost.zh"

stdExtra.zh is here.

 

I'm not sure why string.zh isn't in the database?

I know it's hard to find stuff in the old forum threads, but I think Saffith made it?

I'll try to locate a copy.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users