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
Mimic Enemy Help
Author Message
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #1
Mimic Enemy Help
Howdy all Big Grin i was hoping someone could help me out, im making an NPC which copies the look and name of it's opponent (sort of like a double) but i cant seem to get the horse copied. any help?

IF (<SRC.FINDLAYER(layer_light)> )
NEWITEM=<SRC.FINDLAYER(layer_light).ID>
ACT.ATTR=attr_newbie
ACT.CONT=<UID>
ENDIF
IF (<SRC.FINDLAYER(layer_pack)> )
FINDLAYER(layer_pack).COLOR=<SRC.FINDLAYER(layer_pack).COLOR>
ENDIF
IF (<SRC.FINDLAYER(21)> ) <--------- PROBLEM STARTS HERE
FINDLAYER(21).COLOR=<SRC.FINDLAYER(21).COLOR>
02-22-2013 09:30 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Mimic Enemy Help
Code:
//author unknown

[CHARDEF c_dopple_ganger]
ID=c_man
NAME=Clone
CAN=MT_WALK|MT_RUN|MT_EQUIP|MT_USEHANDS
DESIRES=i_gold
CATEGORY=Monsters
SUBSECTION=Miscellaneous
DESCRIPTION=Doppleganger
ON=@Create
   NPC=brain_human
   STR=100
ON=@NPCSeeNewPlayer
   FINDLAYER(layer_hand1).REMOVE
   FINDLAYER(layer_hand2).REMOVE
   FINDLAYER(layer_shoes).REMOVE
   FINDLAYER(layer_pants).REMOVE
   FINDLAYER(layer_shirt).REMOVE
   FINDLAYER(layer_helm).REMOVE
   FINDLAYER(layer_gloves).REMOVE
   FINDLAYER(layer_ring).REMOVE
   FINDLAYER(layer_light).REMOVE
   FINDLAYER(layer_collar).REMOVE
   FINDLAYER(layer_hair).REMOVE
   FINDLAYER(layer_half_apron).REMOVE
   FINDLAYER(layer_chest).REMOVE
   FINDLAYER(layer_wrist).REMOVE
   FINDLAYER(layer_beard).REMOVE
   FINDLAYER(layer_tunic).REMOVE
   FINDLAYER(layer_ears).REMOVE
   FINDLAYER(layer_arms).REMOVE
   FINDLAYER(layer_cape).REMOVE
   FINDLAYER(layer_robe).REMOVE
   FINDLAYER(layer_skirt).REMOVE
   FINDLAYER(layer_legs).REMOVE
   FINDLAYER(layer_light).REMOVE
   IF (<SRC.FINDLAYER(layer_hand1)> )
   NEWITEM=<SRC.FINDLAYER(layer_hand1).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_hand1).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_hand2)> )
   NEWITEM=<SRC.FINDLAYER(layer_hand2).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_hand2).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_shoes)> )
   NEWITEM=<SRC.FINDLAYER(layer_shoes).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_shoes).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_pants)> )
   NEWITEM=<SRC.FINDLAYER(layer_pants).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_pants).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_shirt)> )
   NEWITEM=<SRC.FINDLAYER(layer_shirt).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_shirt).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_helm)> )
   NEWITEM=<SRC.FINDLAYER(layer_helm).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_helm).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_gloves)> )
   NEWITEM=<SRC.FINDLAYER(layer_gloves).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_gloves).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_ring)> )
   NEWITEM=<SRC.FINDLAYER(layer_ring).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_ring).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_collar)> )
   NEWITEM=<SRC.FINDLAYER(layer_collar).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_collar).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_hair)> )
   NEWITEM=<SRC.FINDLAYER(layer_hair).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_hair).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_half_apron)> )
   NEWITEM=<SRC.FINDLAYER(layer_half_apron).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_half_apron).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_chest)> )
   NEWITEM=<SRC.FINDLAYER(layer_chest).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_chest).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_wrist)> )
   NEWITEM=<SRC.FINDLAYER(layer_wrist).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_wrist).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_beard)> )
   NEWITEM=<SRC.FINDLAYER(layer_beard).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_beard).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_tunic)> )
   NEWITEM=<SRC.FINDLAYER(layer_tunic).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_tunic).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_arms)> )
   NEWITEM=<SRC.FINDLAYER(layer_arms).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_arms).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_cape)> )
   NEWITEM=<SRC.FINDLAYER(layer_cape).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_cape).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_robe)> )
   NEWITEM=<SRC.FINDLAYER(layer_robe).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_robe).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_skirt)> )
   NEWITEM=<SRC.FINDLAYER(layer_skirt).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_skirt).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_legs)> )
   NEWITEM=<SRC.FINDLAYER(layer_legs).ID>
   ACT.COLOR=<SRC.FINDLAYER(layer_legs).COLOR>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_light)> )
   NEWITEM=<SRC.FINDLAYER(layer_light).ID>
   ACT.ATTR=attr_newbie
   ACT.CONT=<UID>
   ENDIF
   IF (<SRC.FINDLAYER(layer_pack)> )
   FINDLAYER(layer_pack).COLOR=<SRC.FINDLAYER(layer_pack).COLOR>
   ENDIF
   STR=<SRC.OSTR>*2
   DEX=<SRC.ODEX> + 50
   INT=(<SRC.OINT>*2)
   HITS=<SRC.MAXHITS>
   STAMINA=<SRC.MAXSTAM>
   MANA=<SRC.MAXMANA>
   MACEFIGHTING=<SRC.MACEFIGHTING>
   MAGERY=<SRC.MAGERY>
   MAGICRESISTANCE=<SRC.MAGICRESISTANCE>
   ARCHERY=<SRC.ARCHERY>
   ANATOMY=<SRC.ANATOMY>
   TACTICS=<SRC.TACTICS>
   WRESTLING=<SRC.WRESTLING>
   PARRYING=<SRC.PARRYING>
   SWORDSMANSHIP=<SRC.SWORDSMANSHIP>
   COLOR=<SRC.COLOR>
   NAME=<SRC.NAME>
   TITLE=the doppleganger
   FAME=<SRC.FAME>
   BODY=<SRC.BODY>
   OBODY=<SRC.OBODY>
ON=@NPCRestock
   ITEM={ random_gold_pile 1 0 2 }
   ITEM=rich_undead_backpack


[EOF]
02-22-2013 09:54 AM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #3
RE: Mimic Enemy Help
use for/endfor to check the layer
it will be a little bit smaller from the code Smile
and also serv.newitem (old code) *g*
02-22-2013 07:37 PM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #4
RE: Mimic Enemy Help
RanXerox has the script very similar to mine, only in a different order, all of it was working apart from the mount, i wasnt sure on the layer.

Phoenix thanks for the advice, just for if anyone wants to know, the horse is Layer 25. ill add my edit now Smile

IF (<SRC.FINDLAYER(25)> ) ////Layer 25 is the horse
NEWITEM=<SRC.FINDLAYER(25).ID>
ACT.COLOR=<SRC.FINDLAYER(25).COLOR>
ACT.ATTR=attr_newbie
ACT.CONT=<UID>
ENDIF

Now here's the hard part. When the NPC dies, i want it to create the Llama or horse or orn that the player was on so it can be tamed. Don't even know where to start with this XD
02-22-2013 08:38 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #5
RE: Mimic Enemy Help
I donĀ“t know. maybe the id of the pet is stored in the memory item (layer 25), so you can do it like
maybe in more1?

ON=@DEATH
serv.newnpc=<findlayer(25).more1>
new.p=<p>
02-22-2013 09:14 PM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #6
RE: Mimic Enemy Help
all done, i did a few extras ontop but you put me on the right line there phoenix, thanks ^^ +1 rep for you Big Grin
(This post was last modified: 02-23-2013 12:08 AM by UltimaAku.)
02-23-2013 12:06 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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