• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Corpse ondeath!

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,812
Solutions
6
Reaction score
822
Hey guys,
Im using my own vocations and outfit
I want if vocation id 1 dies, the corpse turns into corpse itemid X
and if vocation 2 dies, he corpse turns into corpse itemid X
and if vocation 3 dies, he corpse turns into corpse itemid X
and if vocation 4 dies, he corpse turns into corpse itemid X
and if vocation 5 dies, he corpse turns into corpse itemid X
and if vocation 6 dies, he corpse turns into corpse itemid X

Rep++

TFS 0.4
 
#### 1 way ####

go to the uint16_t Player::getLookCorpse() const in player.cpp

and change this function with this:

Code:
uint16_t Player::getLookCorpse() const
{
	uint16_t corpse;
	switch(getVocationId())
	{
		case 1: case 2: case 3: case 4: case 5: case 6: // vocation id
		     corpse = 2886; // corpse it
			break;
		case 7: case 8: case 9: case 10: case 11: case 12:
			corpse = 2945;
			break;
			corpse = 6080; // corpse for vocations not mentioned up, like if he has no vocation
	}
	return corpse;
}

##### 2 way #####

go to the vocations.xml and change id corpse
example:
Code:
<vocation id="1" name="Knight" description="a knight" (...) attackspeed="2000" soulmax="100" gainsoulticks="120" [b]malecorpse="2886" femalecorpse="2886[/b]" fromvoc="1">
 
about the second way!
is it possible to lag/crash or anything goes wrong with it?

btw, i dont have this line in my voc.xml
LUA:
<vocations>
	<vocation id="0" name="Human" description="a human" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="0.0" club="0.0" sword="0.0" axe="0.0" distance="0.0" shielding="0.0" fishing="0.0" experience="1.0"/>
	</vocation>
 
but I want each vocation different corpse ondeath ?

like if voc id 1 dies, it turns to xxx
if voc 2 dies, it turn to yyy
etc
I have 7 vocations
 
i give you my corpse code that works 100% perfect, just change ids and voc:
case is vocation id
corpse is corpse id
Code:
uint16_t Player::getLookCorpse() const
{
	uint16_t corpse;
	switch(getVocationId())
	{
		case 1: case 2: case 3: case 4: case 5: case 6:
		     corpse = 2886; // goku
			break;
		case 7: case 8: case 9: case 10: case 11: case 12:
			corpse = 2945; // vegeta
			break;
		case 13: case 14: case 15: case 16: case 17: case 18:
			corpse = 5989; // brollu
			break;
		case 19: case 20: case 21: case 22: case 23:
			corpse = 6080; // gohan
			break;
		case 24: case 25: case 26: case 27: case 28:
			corpse = 2830; // trunk
			break;
		case 29: case 30: case 31: case 32: case 33: case 34:
			corpse = 2826; // tuffle
			break;
		case 35: case 36:
			corpse = 4265; // cell 1
			break;
		case 37: case 38:
			corpse = 2956; // cell 2
			break;
	    case 39: case 40:
			corpse = 2992; // cell 3
			break;
		case 41: case 42: case 43: case 44: case 45: case 46:
			corpse = 5988; // cooler
			break;
		case 47: case 48: case 49: case 50: case 51:
			corpse = 3028; // freezer
			break;
        case 52:
			corpse = 6002; // mecha freezer
			break;
		case 53: 
			corpse = 10007; // buu 1
			break;
  	    case 54: case 55: case 56: case 57: case 58:
			corpse = 8966; // buu 2
			break;
		case 59:
			corpse = 5980; // janemba
			break;
		case 60:
			corpse = 6320; // janemba
			break;
		case 61: case 62: case 63:
			corpse = 5980; // janemba
			break;
		case 71: case 72:
			corpse = 2935; // human1
			break;
      	case 73:
			corpse = 2860; // human/android
			break;
	   case 74: case 75: case 76:
			corpse = 2860; // android
			break;
		case 77: case 78:
			corpse = 4307; // videl
			break;
        case 79: case 80: case 81: case 82:
			corpse = 4314; // videl/andro
			break;
		case 84: case 85: case 86: case 87: case 88: case 89: case 90: case 91: case 92: case 93: case 94: case 95:
			corpse = 2820; // namki
			break;
		default:
			corpse = 6080; // corpse for vocations not mentioned up, like if he has no vocation
	}
	return corpse;
}

well ive got 80 vocations so xd
 
Last edited:
Back
Top