Jump to content
AnnieRuru

*setmobdata & *getmobdata

Recommended Posts

need to summon a hp 10,000,000 poring ?

or you want to make emperium move ?

yes, this plugin allows you to customize your monsters attribute

 

Download : 1.2

patch <-- rathena fellows, you are welcome to plagiarize this command, since your setunitdata can't change stats LOL

 

I experienced in the past that, sometimes when my internet connection reset, my post will looks like rubbish

this time I will make multiple posts to reduce the risk of my explanation so they wont get edited

 

 

 

1.0 a rush release

plugin

 

1.1

plugin

- remove MOBDATA_NAME field and MOBDATA_DIRECTION field

- add monster's emote constants (found in src/map/status.h)

 

1.2

patch

- will pull request soon, so have to make it as patch

- add cap_value when setmobdata

- copy rathena monster size, no_cast_spells, monster coordinate ... etc

 

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

this post reserve to explain in detail what each constant do

as there are some of them doesn't really work, and some has to work with others

 

1st thing that you need to know is, the monsters stats has been calculated the moment the monster is spawned

so adding modify the monster's agi will not increase its flee, for example

have to modify its flee instead ...

 

damn ... now going out for lunch

having someone stay over really sux

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

frequently asked questions and example script

 

tested with

prontera,155,185,5	script	kdjhfksfdh	1_F_MARIA,{	.@id = monster( "this", -1,-1, "--ja--", PORING, 1, "" );	//	setmobdata .@id, MOBDATA_MODE, getmobdata(.@id, MOBDATA_MODE & ~MD_LOOTER);//	setmobdata .@id, MOBDATA_NORANDOMWALK, 1;	setmobdata .@id, MOBDATA_MAXHP, 800000000;	setmobdata .@id, MOBDATA_HP, 800000000;//	setmobdata .@id, MOBDATA_HIT, 30000;//	setmobdata .@id, MOBDATA_CRITICAL, 30000;	setmobdata .@id, MOBDATA_ATK, 607000;//	setmobdata .@id, MOBDATA_MODE, 70000;//	setmobdata .@id, MOBDATA_MOVESPEED, 70000;	setmobdata .@id, MOBDATA_ATTACK_DELAY, 10;	setmobdata .@id, MOBDATA_ATTACK_MOTION, 10;//	setmobdata .@id, MOBDATA_DAMAGE_MOTION, 70000;	setmobdata .@id, MOBDATA_IMMUNE, 70000;	setmobdata .@id, MOBDATA_ATTACK_RANGE, 14;//	setmobdata .@id, MOBDATA_STR, 327678;//	dispbottom "GID = "+ .@id;//	dispbottom "ID = "+ getmobdata( .@id, MOBDATA_MOBID );//	dispbottom "level = "+ getmobdata( .@id, MOBDATA_LEVEL );//	dispbottom "hp = "+ getmobdata( .@id, MOBDATA_HP );//	dispbottom "maxhp = "+ getmobdata( .@id, MOBDATA_MAXHP );	dispbottom "atk = "+ getmobdata( .@id, MOBDATA_ATK );//	dispbottom "matk = "+ getmobdata( .@id, MOBDATA_MATK );//	dispbottom "def = "+ getmobdata( .@id, MOBDATA_DEF );//	dispbottom "mdef = "+ getmobdata( .@id, MOBDATA_MDEF );//	dispbottom "hit = "+ getmobdata( .@id, MOBDATA_HIT );//	dispbottom "flee = "+ getmobdata( .@id, MOBDATA_FLEE );//	dispbottom "critical = "+ getmobdata( .@id, MOBDATA_CRITICAL );//	dispbottom "perfect dodge = "+ getmobdata( .@id, MOBDATA_PERFECT_DODGE );	dispbottom "str = "+ getmobdata( .@id, MOBDATA_STR );//	dispbottom "agi = "+ getmobdata( .@id, MOBDATA_AGI );//	dispbottom "vit = "+ getmobdata( .@id, MOBDATA_VIT );//	dispbottom "int = "+ getmobdata( .@id, MOBDATA_INT );//	dispbottom "dex = "+ getmobdata( .@id, MOBDATA_DEX );//	dispbottom "luk = "+ getmobdata( .@id, MOBDATA_LUK );	dispbottom "attack range = "+ getmobdata( .@id, MOBDATA_ATTACK_RANGE );//	dispbottom "race = "+ getmobdata( .@id, MOBDATA_RACE );//	dispbottom "element type = "+ getmobdata( .@id, MOBDATA_ELEMENT_TYPE );//	dispbottom "element level = "+ getmobdata( .@id, MOBDATA_ELEMENT_LEVEL );//	dispbottom "mode = "+ getmobdata( .@id, MOBDATA_MODE );//	dispbottom "movespeed = "+ getmobdata( .@id, MOBDATA_MOVESPEED );//	dispbottom "adelay = "+ getmobdata( .@id, MOBDATA_ATTACK_DELAY );//	dispbottom "amotion = "+ getmobdata( .@id, MOBDATA_ATTACK_MOTION );//	dispbottom "dmotion = "+ getmobdata( .@id, MOBDATA_DAMAGE_MOTION );	dispbottom "map = "+ getmobdata( .@id, MOBDATA_MAP );	end;}
the explanation script is not finished, I know

but I kinda in a rush because my sister is coming to stay over here tonite

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

I don't want rathena members come and steal my source edits anymore hahaha

 

1.1

plugin

- remove MOBDATA_NAME field and MOBDATA_DIRECTION field

- add monster's emote constants (found in src/map/status.h)

Share this post


Link to post
Share on other sites

This is way so awesome *_* /lv

 

ETA: I think you can actually set constants inside plugin_init for less hooking involved. I checked that when I was remaking your pcblock pull request into plugin (my actual Herc version is few months old, and probably not updating until deal with monster.conf is finished).

Edited by Garr

Share this post


Link to post
Share on other sites

Didn't rA have this already?

 

http://herc.ws/board/topic/8974-script-command-setmobdata-getmobdata/

 

https://github.com/rathena/rathena/commit/2cee5b6

 

Seems more complete and people wanted it merged. I also dislike plugins myself.

Edited by Anisotropic Defixation

Share this post


Link to post
Share on other sites

I installed it but your test script isn't working, map-server spits out an error about non-existant id 0 or something D:

Share this post


Link to post
Share on other sites

ah ... that example script was ver1.0

 

and when I thought my sister just going to stay for only for Sat and Sun, she actually wants to stay for a whole week

so currently I can't do things that require deep concentration

 

 

EDIT: this format is not final, I saw rathena did that random walk as part of monster mode

which I think they did better on some parts

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

rathena already has it, I thought ?

 

they just don't have atk/matk/flee/hit/critical/perfect dodge ... and mob invulnerable

Share this post


Link to post
Share on other sites

again, 2nd PM come in and asked me to convert this into rathena

because they claimed this script isn't working in rathena

 

... and I don't believe rathena will release stuffs that are "full of bugs"

 

1st reason

I was scripting moderator at rathena forum during year 2013,

so I knew how strict they are when they recruit a core developer

there is no way their developer will make things full of bugs

 

2nd reason

emistry server is probably based on rathena emulator

I'm confident emistry know how to write his mvp ladder with setunitdata

if setunitdata is bug, then he wont be able to make that mvp ladder script with

-> Boss Max HP will increase depend on total amount of party members who joined currently.

 

and, this is the script I tested on my rathena test server

prontera,159,185,5 script kjdsfkshfs 1_F_MARIA,{monster "this", -1,-1, "--ja--", 1002, 1, "";setunitdata $@mobid[0], 3, 10000000;setunitdata $@mobid[0], 2, 10000000;}

.

post-4102-0-09945200-1447327251_thumb.jpg

 

 

the main difference is at the *monster script command

 

hercules *monster script command can be set with any variable, however, only 1 monster at a time

if want to modify 10 monsters, has to use a loop

prontera,155,185,5 script kdjhfksfdh 1_F_MARIA,{for ( .@i = 0; .@i < 10; .@i++ ) {.@id[.@i] = monster( "this", -1,-1, "--ja--", PORING, 1, "" );setmobdata .@id[.@i], MOBDATA_MAXHP, 10000000;setmobdata .@id[.@i], MOBDATA_HP, 10000000;}end;}

.

rathena *monster script command cannot be set, it push $@mobid in an array

prontera,159,185,5 script kjdsfkshfs 1_F_MARIA,{monster "this", -1,-1, "--ja--", 1002, 10, "";for ( .@i = 0; .@i < 10; .@i++ ) {setunitdata $@mobid[.@i], 3, 10000000;setunitdata $@mobid[.@i], 2, 10000000;}end;}

.

so the way rathena and hercules write them are totally different

... and yes, rathena also can't use constant

 

 

EDIT : codebox is broken ...

EDIT2 : nvm leave it ....

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

hmm ...

I actually didn't know rathena already has it when I opened this topic

I admit they at least tried to "make stuffs happens", although some of their design is flaw

 

I think mine is a little bit better, because mine can modify attack damage for monster, which they can't

but rathena also has a few stuffs that I didn't have, like the monster no cast skill flag, and I haven't code setmoblook

 

erm .... HAHAHAHA !!

so rathena monster's stat cannot change due to a bug

https://github.com/rathena/rathena/issues/462

https://github.com/rathena/rathena/issues/516

https://github.com/rathena/rathena/issues/751

 

it doesn't matter now, I copy all their good stuffs, so now mine is better than them

 

patch 1.2

http://upaste.me/ed6c2196382229bc7

crazy 500 lines modification, hercules seriously missing many stuffs

Share this post


Link to post
Share on other sites

I tried to apply this diff with :  git apply file.diff, but show me some errores like:

 

MD_CANMOVE            | 0x00001 |      1setmob.diff:37: trailing whitespace.
MD_LOOTER             | 0x00002 |      2
setmob.diff:38: trailing whitespace.
MD_AGGRESSIVE         | 0x00004 |      4
setmob.diff:39: trailing whitespace.
MD_ASSIST             | 0x00008 |      8
setmob.diff:40: trailing whitespace.
MD_CASTSENSOR_IDLE    | 0x00010 |     16
fatal: corrupt patch at line 509
 

i download this patch

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.