Fix to get some scripts to compile

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.
Locked
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Fix to get some scripts to compile

Post by Yukiko »

I am starting this thread for those interested.

Add the following functions taken from the 96 Distro damage.inc file to \Distro 97\Distro\pkg\mobiles\damage\include\damage.inc

Code: Select all

/*
 * ResistancePercentToMult(percent)
 *
 * Purpose
 * Turns a percentage into a resistance multiplier.
 *
 * Parameters
 * percent
 *
 * Return value
 * Double resistance multiplier
 *
 */
function ResistancePercentToMult(percent)
    if ( percent > 0 )
        //print("% to mult: "+percent+" is: "+(CDbl(100 - percent) * 0.010));
        return CDbl(100 - percent) * 0.010;
    else
        //print("% to mult: "+percent+" is: "+(CDbl(100 + percent) * 0.010));
        return CDbl(100 + percent) * 0.010;
    endif
endfunction

/*
 * ResistancePercentToMult(percent)
 *
 * Purpose
 * Turns a resistance multiplier into a percentage.
 *
 * Parameters
 * mult
 *
 * Return value
 * Int percentage
 *
 */
function ResistanceMultToPercent(mult)
    if ( mult > 0 )
        //print("mult to %: "+mult+" is: "+CInt(100 - (mult * 100)));
        return CInt(100 - (mult * 100));
    else
        //print("mult to %: "+mult+" is: "+CInt(100 + (mult * 100)));
        return CInt(100 + (mult * 100));
    endif
endfunction


Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

You will also need the include file tileEffects.inc from Distro 96. Place it in your ...\scripts\include folder in 97 distro. If you cannot find it I will include it here :

Code: Select all

enum TILE_EFFECTS
	// * general *
	FX_SPLASH         :=  0x352d, //
	FX_EXPLODE_1      :=  0x36ca, //
	FX_EXPLODE_2      :=  0x36bd, //
	FX_EXPLODE_3      :=  0x36b0, //
	FX_FIREBALL       :=  0x36d4, //
	FX_MAGIC_ARROW    :=  0x36e4, //
	FX_FIRE_BOLT      :=  0x36f4, // Firesnake. (pagan?)
	FX_EXPLODE_BALL   :=  0x36fe, // Not used.

	FX_FLAMESTRIKE    :=  0x3709, //
	FX_SMOKE          :=  0x3728,
	FX_TELE_VANISH    :=  0x372a, // Teleport vanish.
	FX_SPELL_FAIL     :=  0x3735, //
	FX_BLESS_EFFECT   :=  0x373a, //
	FX_CURSE_EFFECT   :=  0x374a, //
	FX_SPARK_EFFECT   :=  0x375a, //
	FX_HEAL_EFFECT    :=  0x376a, //
	FX_MARK_EFFECT    :=  0x3779,
	FX_BLUEMOONSTART  :=  0x3789, // Deathvortex?
	FX_ENERGY_BOLT    :=  0x379f, //
	FX_BLADES_EMERGE  :=  0x37a0, // Not used.
	FX_GLOW           :=  0x37b9, // Not used.
	FX_GLOW_SPIKE     :=  0x37c3, // Not used.
	FX_DEATH_FUNNEL   :=  0x37cc, //
	FX_BLADES         :=  0x37eb, //
	FX_STATIC         :=  0x3818, // Not used. (pink static)
	FX_POISON_F_EW    :=  0x3914, // Poison field.
	FX_POISON_F_NS    :=  0x3920, // Poison field.
	FX_ENERGY_F_EW    :=  0x3947, // Energy field.
	FX_ENERGY_F_NS    :=  0x3956, // Energy field.
	FX_PARA_F_EW      :=  0x3967, // Paralyze field.
	FX_PARA_F_NS      :=  0x3979, // Paralyze field.
	FX_FIRE_F_EW      :=  0x398c, // Fire field.
	FX_FIRE_F_NS      :=  0x3996,  // Fire field.

	FX_POISON_GAS     := 0x113a
endenum
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

The reason those 097 spell scripts no longer compile is because those damage.inc functions arent used anymore. I rewrote a big potion of damage.inc and am waiting for Tekproxy to return to update the spells.

Nothing in the 097 distro uses tileEffects.inc
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

OK Austin.

Didn't know what was actually happening there. I figured you were probably between something or other.
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm

Post by tekproxy »

I just got out of a 8 hour car ride and I'm going to be doing one again tomorrow. I haven't had time to rewrite any of scripts yet, but I will. :)

Seriously, if a script doesn't compile, just use ecompile -b. The server will run with a missing script here and there. Or you could just disable the package. This thread will probably be outated every 2 or 3 days, if magery is broken, and 30-45 minutes if it's something Austin is working on.

[edit]
What happened to tileEffects.inc? FX_MARK_EFFECT isn't defined anywhere now. And I'll commit the fixed spell scripts soon.
[/edit]
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Everything that was in tileEffects.inc was already in client.inc too
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Also Tek.. there is a timedScripts dealy now thatll allow for Target*() time out. Look into targetUtil.inc in that package. :)
Locked