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
Question : How to Skin an NPCs without using a bladed weapon
Author Message
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #1
Question : How to Skin an NPCs without using a bladed weapon
Hello,

yesterday i tried to create a function (or Event) which simulates the skinning of an NPC-Monster without the use of a target.
Sadly all my attempts where useless.

It is very simple to achive this by making a Command, equipping a Memory with the right type (ex. t_weapon_sword) and giving the player a target to skin the npc.

The "Problem" is, that i want to make this a racial feature without the need to target the corpse.

Example :
A Troll dies, in the Resource-List he has 5 Hides of Troll-Leather and some meat.
When a Human Character opens the corpse, nothing happens. He still needs to use a bladed weapon to cut up the corpse, before he gets the resources.

But when the char of another race (example Orcisch) opens the corpse, the corpse is getting cut (if not allready) @dclick and the cont opens. But : Without the use of a simulated Weapon and the need to target the corpse.

I tried to mess around with morey/morez, playing around with the tag.blood and so on. But i don't get the right solution :

Questions :
* Is there a way you know of, how to simulate the cutting of the corpse without a real weapon. Is there some kind of sendpacket?
* How do i find out (comparing the values) which corpse is allready cut? I tried it with messing around with the values of the corpse, but in my Worldsave there is no real difference between a cut-up-corpse and a fresh one. Sure, the tag.blood gets reduced, and morez is changed, but if i set it per script, this doesn't mean that i'm no longer able to cut up a fresh NPC

Thanks in advance for every comment and (possibly) hint.

Shidhun
03-27-2014 04:29 PM
Find all posts by this user Like Post Quote this message in a reply
wuffel
Apprentice
*

Posts: 28
Likes Given: 0
Likes Received: 4 in 2 posts
Joined: Mar 2012
Reputation: 1



Post: #2
RE: Question : How to Skin an NPCs without using a bladed weapon
Hi Smile

the "timestamp" - defined on a dead body, says if the body is already carved or not.
if timestamp = 0, than the body isnt carved yet.
if timestamp = "old-server-time", than the body is carved.

you can overload the dclick/itemdclick-Trigger for example and check, if its type t_corpse etc.
(This post was last modified: 03-28-2014 11:02 AM by wuffel.)
03-28-2014 11:01 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #3
RE: Question : How to Skin an NPCs without using a bladed weapon
you can have some fun with t_corpse

the items must be created manually, and MORE1 will check if the corpse is already carved to prevent create these items again

I dont remember how sphere check internally if the corpse is already carved, but maybe its MORE1. You must use the same as the internal function to prevent double-carve (an orc will carve the corpse, then a human will carve it again)

Code:
[TYPEDEF t_corpse]
ON=@DClick
IF (<SRC.RACE>==Orcish) && !(<MORE1>)
  SRC.SYSMESSAGE You're an orc and carved the corpse.
  ARGS=<SERV.CHARDEF.<eval <MOREX>+<MOREY>>.RESOURCES>
  WHILE !(<isempty <ARGV[<LOCAL._WHILE>]>>)
    SERV.NEWITEM <STREAT <ARGV[<LOCAL._WHILE>]>>,<STRARG <ARGV[<LOCAL._WHILE>]>>
    NEW.CONT=<UID>
  ENDWHILE
  MORE1=1
ENDIF
03-28-2014 03:59 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #4
RE: Question : How to Skin an NPCs without using a bladed weapon
Thanks to both of you Smile

A Combination of both works perfectly :

When the corpse is created, a timestamp is set by sphere. If it is then set to 0 (=deletion) the corpse can no longer be carved.
Code:
on=@dclick                
IF (<SRC.isorc>)
    if <timestamp>
        ARGS=<SERV.CHARDEF.<eval <MOREX>+<MOREY>>.RESOURCES>
        WHILE !(<isempty <ARGV[<LOCAL._WHILE>]>>)
            SERV.NEWITEM <STREAT <ARGV[<LOCAL._WHILE>]>>,<STRARG <ARGV[<LOCAL._WHILE>]>>
            NEW.CONT=<UID>
        ENDWHILE
        timestamp=0
    endif
ENDIF
(This post was last modified: 03-29-2014 07:54 PM by Shidhun.)
03-29-2014 07:53 PM
Find all posts by this user Like Post Quote this message in a reply
wuffel
Apprentice
*

Posts: 28
Likes Given: 0
Likes Received: 4 in 2 posts
Joined: Mar 2012
Reputation: 1



Post: #5
RE: Question : How to Skin an NPCs without using a bladed weapon
This is copied out of the revision changelog. So it depends on the sphereversion which value is important for you: more2, or timestamp.
09-02-2014, Ben
-Moved: t_corpse.more1, t_book.more2, t_message.more2, t_eq_memory_obj.more2 to new TIMESTAMP
03-29-2014 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: 3 Guest(s)