Special Arrows!

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Special Arrows!

Post by Damien »

Hello, I have wonder about this script a long long time and unfortnately im to newbie to create it myself.

Offcourse i know you guys dont like to handle out scripts, but i would be extremely happy if someone took time and made it for me.
If i could see this Special arrow attack script i would learn alot and i probably would be able to create other scripts like paralyze and so on.

The script is a ''attack script'' ( i think it's called)

It's gonna do that when the arrow (fire arrow in this case) hit its target
the target will have a flamestrike in himself.

but when it doesnt hit, the target shouldn't get a flamestrike in himself :&
the damage of the flamestrike should offcourse be different.
Example if you got 10 archery it could do 4-5 dmg and if ure Grandmaster Archery maybe 40-50 dmg per hit.

I would be extremmmely happy if someone could create it as i said :)

Please help me!
Sorry for my english.

Code: Select all

Thanks.
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Someone please
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

Post by Bytehawk »

You'll have to let the hitscript member of the bow (yes, the bow, not the arrows do the damage) point to a script that does all the wanted effects.

In your itemdesc.cfg put something like this:

Code: Select all

Weapon 0x9960
{
  Name                    firebow
  desc                    firebow
  Speed                   25
  Damage                  4d4+7
  Attribute               Archery
  Projectile              1
  ProjectileType          0xf3f
  ProjectileAnim          0xf42
  ProjectileSound         0x235
  Anim                    0x12
  MissSound               0x239
  HitSound                0x235
  maxhp                   45
  TwoHanded               1
  strrequired             20
  MinDam                  9
  MaxDam                  41
  minrange        1
  maxrange        15
  equipscript             equip
  unequipscript           unequip
  hitscript           firebowhit
  destroyscript           destroy
}
In firebowhit.src you can then do the fireball:

Code: Select all

program firebowhit(attacker, defender, weapon, armor, basedamage, rawdamage)

  if (defender == attacker)
    SendSysMessage (attacker, "No Cheating");
    ApplyRawDamage (attacker, 1000);
    return 0;
  endif

  [...]

  ApplyRawDamage (defender, RandomInt (10) + 10);
  PlaySoundEffect (defender, SFX_SPELL_FLAME_STRIKE);
  PlayObjectCenteredEffect (defender, FX_FLAMESTRIKE, 7, 7);

endprogram
Can't verify if this really works, since I'm at work right now, but hopefully this puts you on the right path :)
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Sup Thanks for helping me!

The firebow is good just that it missed Graphic but i fixed that ;)

But then when i ecompile the firebowhit i get this error:


Compiling: Pol/pkg/systems/combat/firebowhit.src
Token '(' cannot follow token 'SendSysMessage'
Function SendSysMessage() is not defined.
Error compiling statement at Pol\pkg\systems\combat\firebo
whit.src, Line 4
Error in IF statement starting at File: Pol\pkg\systems\co
mbat\firebowhit.src, Line 3
Error compiling statement at Pol\pkg\systems\combat\firebo
whit.src, Line 3
Error detected in program body.
Error occurred at Pol\pkg\systems\combat\firebowhit.src, L
ine 4
Execution aborted due to: Error compiling file

Thanks for help! ;D
Aeros
Journeyman Poster
Posts: 69
Joined: Mon Apr 24, 2006 10:56 am

Post by Aeros »

Put the following at the top of the hitscript code:

Code: Select all

use uo;
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

Post by Bytehawk »

There's a lot more you can/should do in a hitscript, like checking for ReactiveArmor, doing double damage against NPC, doing no damage on fire resistant NPC and so on. The code above was just an example.

For a real hitscript look at pol/pkg/systems/combat/mainHitScript.src for example.

PS:
SFX_SPELL_FLAME_STRIKE = 0x209
FX_FLAMESTRIKE = 0x3709
or put include "include/client"; at the top of the script.
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

Ahh thx :))
Post Reply