zhad3 / zrenderer

A renderer for Ragnarok Online sprites

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Research Mercenaries rendering

zhad3 opened this issue · comments

commented

Right now Mercenaries are treated as Non-Player sprites. While this is correct in the gameplay sense the actual sprites used are the same like regular player sprites.

In the current state a head is simply attached to the mercenary. However it needs more special treatment. It needs to go through the normal player rendering process which includes rendering a head, possible headgears and also weapon and weapon slash.

The research part is about checking what kind of weapon the mercenaries use as well as the head and headgear (also checking each mercenary tier). The final implementation however should NOT include these by default. The user must make the right call. This makes the renderer more versatile when rendering mercenary sprites.

commented

Research result: Mercenaries have their own rendering implementation.

It consists of 8 layers:

# Label
0 LAYER_BODY
1 LAYER_HEAD
2 LAYER_WEAPON
3 LAYER_WEAPON_SLASH
4 LAYER_ACCESSORY_01
5 LAYER_ACCESSORY_02
6 LAYER_ACCESSORY_03
7 LAYER_ACCESSORY_04

LAYER_BODY

Same as the player sprite: data/sprite/인간족/몸통/<jobname>.{act,spr}

LAYER_HEAD

headid = (jobid % 23) + 1;

if (jobid - 6017 <= 9) {
    // archer, female
    head = "data/sprite/인간족/머리통/여/<headid>_여.{spr,act}"
} else {
    // lancer & swordsman, male
    head = "data/sprite/인간족/머리통/남/<headid>_남.{spr,act}"
}

LAYER_WEAPON

if (jobid - 6017 <= 9) {
    // archer
    weapon = "data/sprite/인간족/용병/활용병_활.{spr,act}"
} else if (jobid - 6027 <= 9) {
    // lancer
    weapon = "data/sprite/인간족/용병/창용병_창.{spr,act}"
} else {
    // swordsman
    weapon = "data/sprite/인간족/용병/검용병_검.{spr,act}"
}

LAYER_WEAPON_SLASH

if (jobid < 6017 || jobid > 6026) {
    // not archer
    if (jobid - 6027 <= 9) {
        // lancer
        slash = "data/sprite/인간족/용병/창용병_창_검광.{spr,act}"
    } else {
        // swordsman
        slash = "data/sprite/인간족/용병/검용병_검_검광.{spr,act}"
    }
}

LAYER_ACCESSORY_01

mercid = jobid - 6017;

if (mercid <= 29) {
	switch (mercid) {
		/* archer */
		/* tier  1 */ case  0: accessory = "여/여_털모자";	// ACCESSORY_FUR_HAT (= 160)
		/* tier  2 */ case  1: accessory = "여/여_골든헤드기어";	// ACCESSORY_GOLDEN_HEADGEAR (= 30)
		/* tier  3 */ case  2: accessory = "여/여_대형금방울";	// ACCESSORY_BIGGOLDEN_BELL (= 175)
		/* tier  4 */ case  3: accessory = "여/여_엘리스모자";	// ACCESSORY_ALICE_HAT (= 208)
		/* tier  5 */ case  4: accessory = "여/여_가부키가면";	// ACCESSORY_GABUKI_MASK (= 214)
		/* tier  6 */ case  5: accessory = "여/여_여왕의투구";	// ACCESSORY_QUEEN_HELM (= 164)
		/* tier  7 */ case  6: accessory = "여/여_지르타스가면";	// ACCESSORY_ZIRTAS_MASK (= 200)
		/* tier  8 */ case  7: accessory = "여/여_실버티아라";	// ACCESSORY_SILVERTIARA (= 218)
		/* tier  9 */ case  8: accessory = "여/여_고양이모자";	// ACCESSORY_CAT_HAT (= 182)
		/* tier 10 */ case  9: accessory = "여/여_예쁜리본";	// ACCESSORY_PRETTY_RIBBON (= 211)
		/* lancer */
		/* tier  1 */ case 10: accessory = "남/남_간호모";	// ACCESSORY_NURSE_CAP (= 64)
		/* tier  2 */ case 11: accessory = "남/남_검은눈가리개";	// ACCESSORY_BLACK_EYECOVER (= 187)
		/* tier  3 */ case 12: accessory = "남/남_고블린가면4호";	// ACCESSORY_GOBLIN_MASK4 (= 174)
		/* tier  4 */ case 13: accessory = "남/남_양모자";	// ACCESSORY_GOAT_HAT (= 205)
		/* tier  5 */ case 14: accessory = "남/남_귀찮은너구리";	// ACCESSORY_LAZY_RACCOON (= 168)
		/* tier  6 */ case 15: accessory = "남/남_돈잃은자의마음";	// ACCESSORY_LOST_MONEY_HEART (= 107)
		/* tier  7 */ case 16: accessory = "남/남_마리오넷모자";	// ACCESSORY_MARIONET_HAT (= 212)
		/* tier  8 */ case 17: accessory = "남/남_라이온마스크";	// ACCESSORY_LION_MASK (= 202)
		/* tier  9 */ case 18: accessory = "남/남_클로스헬멧";	// ACCESSORY_CROSS_HELMET (= 203)
		/* tier 10 */ case 19: accessory = "남/남_로드카호의뿔";	// ACCESSORY_HORN_OF_LORD_KAHO (= 99)
		/* swordsman */
		/* tier  1 */ case 20: accessory = "남/남_반창고";	// ACCESSORY_DAEILBAND (= 147)
		/* tier  2 */ case 21: accessory = "남/남_분노입";	// ACCESSORY_ANGRY_MOUTH (= 194)
		/* tier  3 */ case 22: accessory = "남/남_코끼리모자";	// ACCESSORY_KOKIRI_HAT (= 215)
		/* tier  4 */ case 23: accessory = "남/남_야구모자";	// ACCESSORY_BASEBALL_HAT (= 216)
		/* tier  5 */ case 24: accessory = "남/남_장례건";	// ACCESSORY_KOEAN_FUNERAL_COSTUME (= 77)
		/* tier  6 */ case 25: accessory = "남/남_부용";		// ACCESSORY_PUYONG (= 210)
		/* tier  7 */ case 26: accessory = "남/남_타이거마스크";	// ACCESSORY_TIGER_MASK (= 181)
		/* tier  8 */ case 27: accessory = "남/남_초승달투구";	// ACCESSORY_MOON_HELM (= 213)
		/* tier  9 */ case 28: accessory = "남/남_엔젤링모자";	// ACCESSORY_ANGELING_HAT (= 204)
		/* tier 10 */ case 29: accessory = "남/남_태양신의모자";	// ACCESSORY_SUN_GOD_HAT (= 138)
	}
}
accessory = "data/sprite/악세사리/<accessory>.{act,spr}"

LAYER_ACCESSORY_02

mercid = jobid - 6026;

if (mercid == 0) {
	// archer 10th tier
	accessory = "여/여_꽃잎";		// ACCESSORY_SENTIMENTAL_FLOWER (= 56)
}

mercid -= 10;

if (mercid == 0) {
	// lancer 10th tier
	accessory = "남/남_토스트";	// ACCESSORY_TOAST (=188)
}

accessory = "data/sprite/악세사리/<accessory>.{act,spr}"

LAYER_ACCESSORY_03

mercid = jobid - 6026;

if (mercid == 0) {
	// archer 10th tier
	accessory = "여/여_요정의귀";	// ACCESSORY_TINKER_BELL (= 73)
					// ACCESSORY_ROBOT_BLINDER (= 292)
					// ACCESSORY_HUMAN_BLINDER (= 293)
					// ACCESSORY_ROBOT_EAR (= 294)
					// ACCESSORY_HUMAN_EAR (= 295)
}

mercid -= 10;

if (mercid == 0 || (mercid - 10 == 0)) {
	// lancer & swordsman 10th tier
	accessory = "남/남_요정의귀";	// same as above
}

accessory = "data/sprite/악세사리/<accessory>.{act,spr}"

LAYER_ACCESSORY_04

mercid = jobid - 6026;

if (mercid == 0) {
	// archer 10th tier
	accessory = "여/여_미스틱로즈";		// ACCESSORY_MYSTICROSE (= 198)
}

mercid -= 10;

if (mercid == 0) {
	// lancer 10th tier
	accessory = "남/남_타키우스눈가리개";	// ACCESSORY_TAKIUS (= 184)
}

mercid -= 10;

if (mercid == 0) {
	// swordsman 10th tier
	accessory = "남/남_사이클롭스아이";		// ACCESSORY_CYCLOPS_EYE (= 207)
}

accessory = "data/sprite/악세사리/<accessory>.{act,spr}"