SphereCommunity
Newbie mount's - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Newbie mount's (/Thread-Newbie-mount-s)



Newbie mount's - an0n!m0use - 12-23-2019 08:06 AM

Hi everyone Bye
I really need your help Shifty

I have use this script for the newbie mounts:

PHP Code:
[FUNCTION bodyhex]
LOCAL.body=<HVAL <BODY> & 0ffff>
LOCAL.len=<EVAL STRLEN(<LOCAL.body>)>
RETURN 
0X<STRSUB 1 <dLOCAL.len> <LOCAL.body>>

[
TYPEDEF t_ethernal_mount]
On=@DClick
    LOCAL
.id=<QVAL <TDATA1>?<TDATA1>:<TAG0.ethid>>
    IF <
LOCAL.id>
        IF !((<
SRC.BODY>==c_man) || (<SRC.BODY>==c_woman) || (<SRC.BODY>==c_elf_male) || (<SRC.BODY>==c_elf_female))
            
SRC.MESSAGE @55 You can not mount a pet in your current state!
            RETURN 
1
        ELIF 
(<SRC.FINDLAYER(25).UID>)
            
SRC.SYSMESSAGE @55 You are already mounted!
            RETURN 
1
        
ELSE
            
SERV.NEWNPC=<LOCAL.id>
            NEW.
TAG.eth=<BaseID>
            NEW.
COLOR=<COLOR>
            IF (<
TAG0.ethid>)
                NEW.
TAG.etglobal=<TAG.ethid>
            ENDIF
            IF <
TAG0.conjured>
                NEW.
TAG.conjured = <TAG0.conjured>
            ENDIF
            NEW.
TAG.color=<COLOR>
            
REF1=<NEW>
            
SERV.NEWITEM=i_memory
            
NEW.COLOR=memory_ipet
            
NEW.LINK=<SRC>
            NEW.
CONT=<REF1>
            
REF1.MOUNT=<SRC>
            
SRC.EVENTS +e_ethernal_mount
            REMOVE
        
ENDIF
    ELSE
        
SERV.LOG Problems with <UID> (<NAME>) [t_ethernal_mountno TDATA1 nor TAG.ethid
        
RETURN 1
    
ENDIF
    RETURN 
1

On
=@DropOn_Ground
    
IF (<LINK> != 04fffffff) && (<LINK> == <SRC.UID>)
        
CONT=<SRC.FINDLAYER.21>
        
DispID=<SERV.CHARDEF.<TAG.ethid>.ICON>
        
UPDATE
        
RETURN 1
    
ENDIF 

This one is example of mount:
PHP Code:
[ITEMDEF i_newbie_mustang]
DEFNAME=i_newbie_mustang
NAME
=Newbie Mustang
ID
=i_pet_horse_brown_dk
TYPE
=t_ethernal_mount
TDATA1
=c_horse_brown_dk
WEIGHT
=5

On
=@Create
    ATTR
=attr_newbie 

And i have issue in the game when i save the world Sad
How to fix that ?
PHP Code:
ERROR:GC4 unplaced object deleted
ERROR
:UID=036d6id=0db 'Orn'Invalid code=3202 (Object not placed in the world)
ERROR:UID=03824, id=0cc 'Horse'Invalid code=3202 (Object not placed in the world)
ERROR:UID=0383bid=0cc 'Horse'Invalid code=3202 (Object not placed in the world)
ERROR:UID=03891, id=0cc 'Horse'Invalid code=3202 (Object not placed in the world



RE: Newbie mount's - Coruja - 12-23-2019 09:49 AM

After create an item/char it must be always placed somewhere

The "SERV.NEWITEM i_memory" is getting equipped on char using "NEW.CONT=<REF1>", but "SERV.NEWNPC <LOCAL.id>" is not getting placed anywhere, so you must place it on world using something like "NEW.P=<SRC.P>"


RE: Newbie mount's - an0n!m0use - 12-24-2019 03:49 AM

(12-23-2019 09:49 AM)Coruja Wrote:  After create an item/char it must be always placed somewhere

The "SERV.NEWITEM i_memory" is getting equipped on char using "NEW.CONT=<REF1>", but "SERV.NEWNPC <LOCAL.id>" is not getting placed anywhere, so you must place it on world using something like "NEW.P=<SRC.P>"
Cheers, bud Wink