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:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MountItem/MountNPC
Author Message
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #1
MountItem/MountNPC
After a short discussion with Xun this AM, this was going to be released just as a Quick way (Which does no checks), but Xun banks on people not understanding the code (and I should too) so his function is provided (and I reworked it a bit to make it more logical).

My way will also be shown as well; but since we always have to bank on people not understanding how the code works and what should and should NOT be allowed... Xun's way is safer for people.

This is like Item= ItemNewbie= etc. Set it in your @Create or call it as a normal function in game if you'd like. It only takes the parameter for the Mount Creature.

E.g. MountNpc=c_Reptalon
Code:
[Function MountNPC]
If !(<Serv.CharDef.<ArgS>>)
Serv.Log <UID>:<UID.Name> mount <ArgS> failed. Invalid CharDef.
Return
EndIf
Serv.NewNpc=<ArgS>
New.P=<P>
Mount=<New>
Ref1=<New>
If !(<FindLayer.25>) || (<IsGargoyle>)
Serv.Log <UID>:<UID.Name> mount <New.Name> failed. Invalid mount.
Ref1.Remove
EndIf

Now, if you actually do understand mounts and what should and should not be done. This is the fastest method for your servers without using a function call and can be used directly in @Create on an NPC (my way).

Code:
[ItemDef iMountItemHorse1]
ID=03E9F
Type=t_Eq_Horse

Category=Server
Subsection=Mount Items
Description=Horse 1

On=@Create
More1=0C8

Which can be used like this in @Create:
Code:
On=@Create
// Your code here
ItemNewbie=iMountItemHorse1

Even on dismount this SHOULD create a horse mount for you of BaseID=0C8
(This post was last modified: 03-20-2016 10:33 PM by Khaos.)
03-20-2016 10:10 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)