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-nmm7 (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-nmm7 (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-nmm7 (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
ON=@DESTROY change tag
Author Message
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #1
ON=@DESTROY change tag
Hi! First sry for the english Sad

Ive created a new system of Air, Fire, Water, and Earth Elementals.
You can cast ONLY 1 elemental per time, [With a item] so... You can't get 2 items of 2 elementals... [You only cast 1 elemental type with the item...] and you only can have 1 type item to cast Smile
(You can choose what type of mage you are Tongue)
So, this it's DONE.
Now I have a problem here...


I want to let the players cast ONLY 1 ELEMENTAL OF THE SAME TYPE.
So I have created this:

Code:
IN THE SPELL

ON=@START
if !(<findid.i_talisman_aire>)
Sysmessage @50 You need a air talisman to cast this.
return 1
endif
IF (<SRC.MAGERY> < 100.0) || (<SRC.EVALUATINGINTEL> < 100.0) || (<SRC.MEDITATION> < 100.0)
sysmessage @50 You don't have magery, or eval or meditation to cast this
sysmessage @40 Your talisman has erased!
SRC.f_clear_elem // function that erase the talismans
Return 1
endif
IF (<SRC.TAG0.CASTEANDOELEMENTAL>=1)
sysmessage @50 You can only cast 1 elemental per time
return 1
endif
SRC.TAG0.CASTEANDOELEMENTAL=1

ON=@Fail
SRC.TAG0.CASTEANDOELEMENTAL =

This works Flawless.
But I have now a problem with the ELEMENTAL NPC

Code:
ON=@DESTROY
act.sysmessage @50 Now you can cast again a elemental!
act.tag0.casteoelemental.remove

This... Doesn't works becuase erase the tag of the KILLER of the elemental and not to the OWNER of the elemental.
I have try with ON=@DEATH and the same things and nothing. Too I have try with src.tag0, i.tag... etc.
And I don't want a Bug or something else with all release* spk


What can I do?

Thanks ! Smile

Lazarus!

[Image: 2hy9q0y.png]
(This post was last modified: 09-05-2012 05:09 AM by Lazarus.)
09-05-2012 05:08 AM
Visit this user's website 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: #2
RE: ON=@DESTROY change tag
In the memory object(layer 30) inside your elemental, in the LINK attribute there is the UID of the owner.
09-05-2012 05:26 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #3
RE: ON=@DESTROY change tag
Fixed!
Im not using on=@death and on=@destroy. I should use bot.

I have a new problem now:

ALL RELEASE in the elemental don't take out the tag.


Any idea?

thanks! Smile

[Image: 2hy9q0y.png]
09-05-2012 03:49 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Gadianton
Apprentice
*

Posts: 5
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #4
RE: ON=@DESTROY change tag
Quote:ALL RELEASE in the elemental don't take out the tag.

A tag needs to be taken out by specific code. Since "release" doesn't kill the creature (@Death or @Destroy) the Tag will stick... also since release breaks the link to the owner the @Death tag will probably not work properly when the creature finally dies.
You probably have to navigate around this by attaching a speech event to the summoned creature that triggers on the word "Release" and clears the Tag there instead of the @Death Trigger.
Code:
[SPEECH spk_conjuredelemental_release] // dumb long name I know..

ON=*release*
  IF <SRC.UID>==<OWNER.UID>
    // Take out elemental cast tag.
    I.TAG0.CASTEANDOELEMENTAL=
  ENDIF

Important probably is that you don't RETURN 1 out of this one or you might mess up the release process as a whole.

Maybe that will work?

Gadianton
(This post was last modified: 09-07-2012 03:55 AM by Gadianton.)
09-07-2012 03:55 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #5
RE: ON=@DESTROY change tag
(09-07-2012 03:55 AM)Gadianton Wrote:  
Quote:ALL RELEASE in the elemental don't take out the tag.

A tag needs to be taken out by specific code. Since "release" doesn't kill the creature (@Death or @Destroy) the Tag will stick... also since release breaks the link to the owner the @Death tag will probably not work properly when the creature finally dies.
You probably have to navigate around this by attaching a speech event to the summoned creature that triggers on the word "Release" and clears the Tag there instead of the @Death Trigger.
Code:
[SPEECH spk_conjuredelemental_release] // dumb long name I know..

ON=*release*
  IF <SRC.UID>==<OWNER.UID>
    // Take out elemental cast tag.
    I.TAG0.CASTEANDOELEMENTAL=
  ENDIF

Important probably is that you don't RETURN 1 out of this one or you might mess up the release process as a whole.

Maybe that will work?

Gadianton

Works with ACT.TAG0.casteandoelemental=

[ACT] i had change

but... I have a new problem.

If i use *RELEASE* first works the other function of release and the monster get released without take me out the tag.
If i use something like *RELEASE1* works perfectly, but my monster keeps be mine...

But i want to use the normal release.

I can change the release or all release function to add the act.tag0.casteandoelemental=

thanks! Smile

[Image: 2hy9q0y.png]
09-07-2012 06:14 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #6
RE: ON=@DESTROY change tag
Here is another idea... Instead of using the tag as a counter, why not store the UID's of the summoned creatures in the tag as a comma separated list. Then use @destroy or whatever trigger it is that is running twice and in that trigger remove the uid from the list... if its already removed by the time the second trigger executes, you won't care cause the end result is achieved. In the "summon", count the number of entries in the list and make your allow/disallow decision from that.
09-07-2012 08:34 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #7
RE: ON=@DESTROY change tag
Fixed ! I had added in the sphere_speech this:

FIRST, i put the ON=RELEASE on the top, because the lines of script works in the all commands and fuction over there.

Code:
[SPEECH spk_pet]
// Pets that cannot talk
ON=RELEASE
if (<src.tag0.casteandoelemental>)
if (<src.uid>==<owner.uid>)
SRC.tag.casteandoelemental=
endif
endif
ON=KILL
ON=ATTACK
ON=COME
ON=DEFEND ME
ON=DISMISS
ON=DROP    // "GIVE" ?
ON=DROP ALL
ON=FETCH
ON=FOLLOW
ON=FOLLOW ME
ON=FRIEND
ON=GO
ON=GUARD
ON=GUARD ME
ON=SPEAK
ON=STAY
ON=STAY HERE
ON=STOP
ON=TRANSFER

If I use this:
Code:
[spk...]
ON=KILL
ON=RELEASE
if (<src.tag0.casteandoelemental>)
if (<src.uid>==<owner.uid>)
SRC.tag.casteandoelemental=
endif
endif
ON=ATTACK

the tag works in KILL and RELEASE Smile


Thanks to all Smile rly !

I love so much your souls (?

Lazarus.

[Image: 2hy9q0y.png]
(This post was last modified: 09-07-2012 12:49 PM by Lazarus.)
09-07-2012 12:48 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #8
RE: ON=@DESTROY change tag
Now I have a new challenge...

When you attack your own elemental they refuses your owner...

And then, when he gets dead don't takes out the tag.

Any idea?

like: A tag when you save the old master and then when you get dead forget's the owner


Thanks!

[Image: 2hy9q0y.png]
09-10-2012 03:14 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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