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
Ethereal turns normal pet on dismount.
Author Message
Baal
Apprentice
*

Posts: 24
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Jul 2013
Reputation: 0



Post: #1
Ethereal turns normal pet on dismount.
Hello,im having issues with an ethereal system on my shard.
The ethereal pets are running well except when dismount.
I add ethereal pet,ok,its a statuette in backpack,i double click it,ok,i mount an ethereal ride,but when i doubleclick on me to dismount,a normal pet appear.
Here is the picture:

[Image: 2rmb512.png]

And here is the script:

Code:
//                                            Warning:
//Supossed to work with any Sphere version with the mount function (you can create this one if not) and the @Dismount trigger (this one is mandatory, otherwise it won't work).
//This script assumes that you have the correct chardefs from default script pack, as it uses these mounts and not a custom, and not needed, ones.
//
//This script contains all mounts in ethereal form, plus a item that transforms itself in a ethereal of the char in wich you drop it
//(You drop it in a horse? then its a ethereal horse, if y ou drop it again in another mount it transforms again)
//
//This are the IDs of the ethereals:
//
//i_et_global
//i_et_zostrich
//i_et_hiryu
//i_et_oclock
//i_et_beetle
//i_et_orn
//i_et_horse
//i_et_llama
//i_et_bear
//i_et_cu_shide
//i_et_kirin
//i_et_undead
//i_et_reptalon
//i_et_unicorn
//i_et_ridgeback
//i_et_ridgeback_savage
//i_et_swamp_dragon
//i_et_swamp_dragon_armored
//i_et_boura_armoured
//
//
//
//By default all the mounts have attr_newbie.
//
//Their behaviour is controlled by one typedef 't_eth', wich handles all the code instead of creating a block per each one, modify what you want in this typedef.


[function bodyhex]    //this function returns the body in hex format to be able to read the mount's defnames in sphere_defs.scp (mount_0x444 in example)
local.body=<hval <body> & 0ffff>
local.len=<eval STRLEN(<local.body>)>
return 0x<strsub 1 <dlocal.len> <local.body>>


[typedef t_eth]
//This typedef handles almost all of the Ethereal's behaviour
on=@Dclick
local.id=<qval <tdata1>?<tdata1>:<tag0.ethid>>    //check for the source, a normal ethereal or a mount cloner
if <local.id>    //If a id is received then the code proceed
    IF !((<SRC.Body>==c_man) || (<SRC.Body>==c_woman) || (<SRC.Body>==c_elf_male) || (<SRC.Body>==c_elf_female))    //Only humans and elfs can mount, if you have humanoids races add them here.
        SRC.SysMessage=<defmsg.msg_mount_unable>
        Return 1
    Else
        serv.newnpc=<local.id>    //When ridding it, a real NPC with this ID is created
        new.tag.eth=<baseid>
        new.color=<color>
        if (<tag0.ethid>)        //If it's a cloner it have this tag, we transfer it to the npc to retrieve it back later.
            new.tag.etglobal=<tag.ethid>
        endif
        new.tag.color=<color>
        ref1=<new>
        serv.newitem=i_memory    //A memory_ipet is given to the NPC, so the player can ride it.
        new.color=memory_ipet
        new.link=<src>
        new.cont=<ref1>
        ref1.mount=<src>        //this function does dismount you if needed, hence I didn't check it before.
        src.events +e_ridding_eth    //This event handle the @Dismount, the rest of the script
        remove
    Endif
else
    serv.log Problems with <uid> (<name>) [t_eth] no tdata1 nor tag.ethid.
    return 1
ENDIF
return 1

on=@DropOn_Ground    //A simple quick fix to avoid players to drop their Ethereals by accident.
cont=<src.findlayer.21>
if (<tag0.ethid>)
    dispid=<serv.chardef.<tag.ethid>.icon>
    update
endif
return 1

ON=@AfterClick        //A message when clicking the ethereal to avoid scam in trades
local.clickmsghue=0480
local.clickmsgtext=You see a real <name>

[events e_ridding_eth]
ON=@Dismount
events -e_ridding_eth    //The event is removed in first place, to avoid possible problems later
ref1=<argo>
if (<ref1.tag0.eth>)    //However a double check is done to ensure that the mount is a Ethereal one
    serv.newitem=<ref1.tag.eth>
    new.color=<ref1.color>
    if (<ref1.tag0.etglobal>)
        new.tag.ethid=<ref1.tag.etglobal>
        new.dispid=<ref1.icon>
    endif
    new.cont=<findlayer.21>
    findlayer.25.remove
    return 1
endif

[ITEMDEF i_et_global]
ID=i_pet_horse_brown_dk
NAME=Mount Cloner
TYPE=t_eth

ON=@Create
color=078ff
ATTR=04

on=@DropOn_Char
if (<def0.mount_<argo.bodyhex>>)
tag.ethid=<argo.baseid>
name=Mount Cloner (<argo.name>)
color=<argo.color>
dispid=<argo.icon>
update
else
src.sysmessage That cannot be mounted.
endif
return 1

[ITEMDEF i_et_hiryu]
DEFNAME=i_et_dragon
ID=i_pet_hiryu
NAME=Ethereal Hiryu
TYPE=t_eth
tdata1=c_hiryu

ON=@Create
color=078ff
ATTR=04

[ITEMDEF i_et_zostrich]
ID=i_pet_ostard_frenzied_2
NAME=Ethereal Zostrich
TYPE=t_eth
tdata1=c_ostard_zostrich

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_oclock]
ID=i_pet_ostard_desert
NAME=Ethereal Oclock
TYPE=t_eth
tdata1=c_ostard_desert

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_orn]
ID=i_pet_ostard_forest_2
NAME=Ethereal Orn
TYPE=t_eth
tdata1=c_ostard_forest

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_beetle]
ID=i_pet_beetle_fire
NAME=Ethereal Beetle
TYPE=t_eth
tdata1=c_giant_beetle

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_horse]
DEFNAME=i_et_eh
ID=i_pet_horse_brown_dk
NAME=Ethereal Horse
TYPE=t_eth
tdata1=c_horse_brown_dk

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_llama]
ID=i_pet_llama
NAME=Ethereal llama
TYPE=t_eth
tdata1=c_llama

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_bear]
ID=i_pet_bear_polar
NAME=Ethereal Bear
TYPE=t_eth
tdata1=c_bear_polar

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_cu_sidhe]
ID=i_pet_wolf
NAME=Ethereal Wolf
TYPE=t_eth
tdata1=c_cu_sidhe

ON=@Create
color=078ff
ATTR=04


[ITEMDEF i_et_kirin]
DEFNAME=i_kirin
ID=i_pet_kirin
NAME=Ethereal Kirin
TYPE=t_eth
tdata1=c_kirin

ON=@Create
color=078ff
ATTR=04

[ITEMDEF i_et_ridgeback]
DEFNAME=i_ridgeback
ID=i_pet_ridgeback
NAME=Ethereal Ridgeback
TYPE=t_eth
tdata1=c_ridgeback

ON=@Create
ATTR=04

[Itemdef i_et_swamp_dragon]
ID=i_pet_dragon_swamp
NAME=Ethereal Swamp Dragon
TYPE=t_eth
tdata1=c_swamp_dragon

ON=@Create
color=078ff
ATTR=04


[Itemdef i_et_swamp_dragon_armored]
ID=i_pet_dragon_swamp
NAME=Ethereal Swamp Dragon Armored
TYPE=t_eth
tdata1=c_armored_swamp_dragon

ON=@Create
color=078ff
ATTR=04


[Itemdef i_et_reptalon]
ID=i_pet_reptalon
NAME=Ethereal Reptalon
TYPE=t_eth
tdata1=c_reptalon

ON=@Create
color=078ff
ATTR=04

[Itemdef i_et_ridgeback_savage]
ID=i_pet_ridgeback
NAME=Ethereal Savage Ridgeback
TYPE=t_eth
tdata1=c_savage_ridgeback

ON=@Create
ATTR=04

[Itemdef i_et_undead]
ID=i_pet_skeletalmount
NAME=Ethereal Undead Horse
TYPE=t_eth
tdata1=c_skeletal_mount

ON=@Create
ATTR=04

[Itemdef i_et_unicorn]
ID=i_pet_unicorn
NAME=Ethereal Unicorn
tdata1=c_unicorn
TYPE=t_eth

ON=@Create
ATTR=04

[Itemdef i_et_boura_armoured]
ID=i_pet_boura_armoured
NAME=Ethereal Armoured Boura
tdata1=c_boura_armoured
TYPE=t_eth

ON=@Create
ATTR=04

//[ITEMDEF 03ea7]         //Mounted animation removed from muls, might work on old/patched game versions
//DEFNAME=I_MT_Vortex
//TYPE=T_EQ_HORSE
//LAYER=25

Thanks in advance for the help.
12-11-2016 10:47 PM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #2
RE: Ethereal turns normal pet on dismount.
[events e_ridding_eth]
ON=@Dismount
events -e_ridding_eth //The event is removed in first place, to avoid possible problems later
ref1=<argo>
if (<ref1.tag0.eth>) //However a double check is done to ensure that the mount is a Ethereal one
serv.newitem=<ref1.tag.eth>
new.color=<ref1.color>
if (<ref1.tag0.etglobal>)
new.tag.ethid=<ref1.tag.etglobal>
new.dispid=<ref1.icon>
endif
new.cont=<findlayer.21>
ref1.remove
return 1
endif

Si la montura te aparece en la mochila simplemente pon eso. Si el item no aparece en la mochila habría q mirarlo más a fondo para ver donde está el error.
12-19-2016 11:30 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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