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
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pet Hunger
Author Message
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #1
Pet Hunger
Good night people. I need your help in a script.

I inserted a hunger system in pets, so that the player have to feed the animals periodically. However I can not achieve my goal. I wanted when the animal had less than 2 food he left the player and stay ownerless.

Until now I have this

Code:
[function isfood]
IF (<type>==t_fruit) || (<type>==t_grain) || (<type>==t_meat_raw) || (<type>==t_food_raw) || (<type>==t_food)
return 1
else
return 0
ENDIF

[EVENTS e_pet_food]

ON=@ReceiveItem
if (<food> >= 64)
    emote is full
return 1
elseif (<argo.isfood>)
    food=<food> +2
        emote eats <argo.name>
            argo.remove
endif


ON=@npclostteleport
return 1

ON=@Hunger
if (<food> <= 30 )
emote are hungry
endif

ON=@Spelleffect
ref1=<tag0.dono>
    if (!(<ref1>))
        ref1=<owner>
            endif
if (<ref1> == <src>)
    if (<serv.spell.<argn1>.flags>&spellflag_harm)
        return 1
    endif
endif
(This post was last modified: 05-11-2015 10:31 AM by Van Glan Bloom.)
05-11-2015 10:30 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Pet Hunger - Van Glan Bloom - 05-11-2015 10:30 AM
RE: Pet Hunger - XuN - 05-11-2015, 05:27 PM
RE: Pet Hunger - Van Glan Bloom - 05-11-2015, 10:55 PM
RE: Pet Hunger - XuN - 05-12-2015, 02:36 AM
RE: Pet Hunger - Van Glan Bloom - 05-12-2015, 09:47 AM
RE: Pet Hunger - XuN - 05-12-2015, 05:00 PM
RE: Pet Hunger - Van Glan Bloom - 05-14-2015, 10:57 PM
RE: Pet Hunger - XuN - 05-15-2015, 04:49 AM

Forum Jump:


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