The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help to use Object as Source from the attack
Author Message
pyrilin
Apprentice
*

Posts: 7
Likes Given: 8
Likes Received: 2 in 2 posts
Joined: Jul 2017
Reputation: 0

MYT Shard

Post: #1
Question Help to use Object as Source from the attack
Hi guys
I've read the tutorial in the wiki and started my first project

it should be a cannon, but i am in trouble to use the cannon as source. The shoot came from the player and not from the cannon Cry

PS:. Sorry about my english

PHP Code:
On=@Dclick

    
if (<distance> > 1) && (!<src.isgm>)
        
src.sysmessageyellow Esta longe demais do canhao.  //it's too far
        
return 1
    
endif
    if (<
timer> > -1) && (!<src.isgm>)
        
src.sysmessageyellow O canhao ainda esta muito quente // the cannon is still very hot
        
return 1
    
endif
    if (<
src.findlayer.(02).baseid>!=i_candle_lit) && (<src.findlayer.(02).baseid>!=i_torch_lit) && (<src.isgm>)
        
src.sysmessageyellow Para acender o pavil voce precisa de algo como uma vela ou uma tocha acessa na mao//Do you need fire to ignite
        
return 1
    
endif
    if (<
src.restest 1 i_cannon_ball>) && (!<src.isgm>)
        else
        
src.sysmessageyellow Voce precisa de uma bola de canhao para atirar//do you need a cannon ball
        
return 
    
endif
    if (<
src.restest 1 i_reag_sulfur_ash>) && (!<src.isgm>)
        else
        
src.sysmessageyellow Voce precisa de polvora para o disparo//do you need sulfur ash
        
return 
    
endif

    
target
    
return 1

on
=@targon_char
    src
.consume=1 i_cannon_ball1 i_reag_sulfur_ash
    argo
.effect 0,0e73,15,0,//i think so that the problem is around here
    
argo.damage={5 15}
    
argo.spelleffect 116300
    src
.sound=011e
    timer
=
    effect 2
,i_fx_smoke,0,14,//this effect is terrible, i am looking for a better one
return 1


On
=@Timer
    timer
=-1
    
if <timer> == -1)
        
emotered esfriou //cooled
        
return 1
    
endif
return 

(This post was last modified: 07-27-2017 11:00 PM by pyrilin.)
07-27-2017 10:57 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Help to use Object as Source from the attack
"EFFECT 0" is a bit tricky because it always goes from SRC to TARGET, but in most cases the function is the target itself, which will revert the SRC <==> TARGET on animation

so instead "ARGO.EFFECT 0" you can use "SRC.TRYSRC <ARGO> EFFECT 0" or "ARGO.TRYSRC <SRC> EFFECT 0" as workaround
07-27-2017 12:11 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
pyrilin
Apprentice
*

Posts: 7
Likes Given: 8
Likes Received: 2 in 2 posts
Joined: Jul 2017
Reputation: 0

MYT Shard

Post: #3
Sad RE: Help to use Object as Source from the attack
(07-27-2017 12:11 PM)Coruja Wrote:  "EFFECT 0" is a bit tricky because it always goes from SRC to TARGET, but in most cases the function is the target itself, which will revert the SRC <==> TARGET on animation

so instead "ARGO.EFFECT 0" you can use "SRC.TRYSRC <ARGO> EFFECT 0" or "ARGO.TRYSRC <SRC> EFFECT 0" as workaround

Tyvm, but dont work Sad

argo.trysrc <src> effect 0,0e73,15,0,0 //if i use it, the ball came from me, and not from the cannon

src.trysrc <argo> effect 0,0e73,15,0,0 //if i use it, the ball came from the final target (the victim of shoot)

i also tried it:
src.targ.effect 0,0e73,15,0,0 //if i use it, the ball came from me, and not from the cannon

what I'd like to happen:
https://media.giphy.com/media/3oeHLj0wPM.../giphy.gif

what is happening:
https://media.giphy.com/media/xUn3CjHQcS.../giphy.gif
07-28-2017 02:21 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Help to use Object as Source from the attack
If i remember well trysrc doesn't work with items UID, you will get a sort of invalid uid error in the console. The only way to send an animation from an item is from the sendpacket function i think.
07-28-2017 07:05 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)