Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-16-2010, 11:57 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by DustyPorViva View Post
From what I remember, the old shootX()'s work off the NPC's x/y instead of the player's.

Something like:

this.x = player.x;
this.y = player.y;
shootarrow(player.dir);

might work. However, I'm pretty sure you don't need to take precautions like this(as WNPC's should by, default, be positioned at the player's x/y). Default bows are actually scripted and simply use shootarrow(player.dir).
yes, i know about the bow, but i need shootnuke, shootfireball, ect too.
i don't see how setting this.x/y to player's x/y is going to change the shootarrow, but i'll try that tomorrow anyway.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #2  
Old 02-17-2010, 12:01 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Deas_Voice View Post
yes, i know about the bow, but i need shootnuke, shootfireball, ect too.
i don't see how setting this.x/y to player's x/y is going to change the shootarrow, but i'll try that tomorrow anyway.
Well back in the day, bows like the super bow(which fire 4 arrows of all types in a row) would change the position of the weapon NPC in relation to the player, to change the placement of the arrow. So doing something like:

PHP Code:
if (weaponfired) {
  
shootarrow playerdir;
  
playery 1;
  
shootnuke playerdir;
  
playery 1;
  
shootfireball playerdir;

Would make the arrow shoot normally, with a fireball above it and a nuke below it.

However, I'm not even sure that will work anymore as I'm pretty sure Stefan make this.x/y not accessible via script in WNPCs since a lot of old weapon scripts used those without intending to alter the position of the weapon's x/y.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.