• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[C++] Help in Skulls

perdigs

New Member
Joined
Aug 22, 2010
Messages
114
Reaction score
1
you can change this line in monster.cpp
[cpp]setSkull(mType->skull);[/cpp]
to this
[cpp]setSkull((Skulls_t) random_range(2, 4));[/cpp]

they'll get a skull with ID between 2 and 4
Code:
SKULL_YELLOW = 1
[B]SKULL_GREEN = [COLOR="red"]2[/COLOR]
SKULL_WHITE = [COLOR="red"]3[/COLOR]
SKULL_RED = [COLOR="red"]4[/COLOR][/B]
SKULL_BLACK = 5

Cykotitan made this change in sources but have monsters with a skull is only 2 or only 4
i need a change to set creatures names to set only skull 2 and only skull 4 please help me in this script...

kind Regards
 
[cpp] if (_mType->name == "nameofcreature")
setSkull(SKULL_GREEN);
else if (_mType->name == "nameofcreature")
setSkull(SKULL_RED);
else setSkull((Skulls_t) random_range(2, 4));[/cpp]

if you wanna make that with many monsters you have to make an array, i don't know exactly the syntax, let me read, if i get it i'll teach you :)
 
This name is like in monsters.xml or like in name in monster.xml
example

monsters.xml
Code:
<monster name="[B][COLOR="red"]Dragon A[/COLOR][/B]" file="Monsters- Editeds/DragonA.xml"/>

is this name or

DragonA.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="[B][COLOR="red"]Dragon Red Skull[/COLOR][/B]" nameDescription="a Dragon Red Skull" race="undead" experience="1900" speed="230" manacost="0">

this name ?

Its a little question.
 
Last edited:
the name from monsters.xml is not being stored in variables of class mType, it's only there temporary (during load time)
 
Last edited:
also you can use:
[cpp]_mType->nameDescription[/cpp]
it will check the description of the monster, so, if you wanna create two nidoran with the name in xml, you can easily check the description: "a nidoran male", " a nidoran female" :p
 
Where will i add this?

if (_mType->name == "nameofcreature") <-- i gone write something in it or what?
setSkull(SKULL_GREEN);
else if (_mType->name == "nameofcreature") <-- i gone write something in it or what?
setSkull(SKULL_RED);
else setSkull((Skulls_t) random_range(2, 4));
 
Back
Top