Euphy Posted December 27, 2012 Posted December 27, 2012 These would be good to have. :> Objections? Code from Freya: https://ookoo.org/svn/freya/trunk/src/map/script.c /*========================================== * sit - Makes a player sit *------------------------------------------ */ int buildin_sit(struct script_state *st) { struct map_session_data *sd = script_rid2sd(st); if (sd) { // Sit down pc_setsit(sd); clif_sitting(sd); } return 0; } /*========================================== * stand - Makes a player stand *------------------------------------------ */ int buildin_stand(struct script_state *st) { struct map_session_data *sd = script_rid2sd(st); if (sd) { // Stand up pc_setstand(sd); clif_standing(sd); } return 0; }
Aleos Posted December 27, 2012 Posted December 27, 2012 For some reason all I could think of with this was playing Musical Chairs. Are there NPCs that make player sit/stand?
Brian Posted December 27, 2012 Posted December 27, 2012 (If we decide to add this,) should the sit script command do unit_stop_walking first?
Euphy Posted December 27, 2012 Author Posted December 27, 2012 @Aleos: No, this would only be custom. It's not very much code, so I thought, "why not?" xD. @Brian: Oh, I didn't see that! Yeah, that looks much better.
AnnieRuru Posted December 28, 2012 Posted December 28, 2012 lol ! if this one going to add, then why not also add issit() script command ? xD if ( issit() ) stand; else sit; something like this probably going to be useful in certain event scripts 2
Euphy Posted December 31, 2012 Author Posted December 31, 2012 and @sitall as well That would be easy to write a script/mod for, but not really needed in the SVN. XD 1
Moriarty Posted December 31, 2012 Posted December 31, 2012 Sit/Stand isn't needed too if you analize o.O They're all extra 'tools' to make the adm's life easier haha @sitall is very good for event organizing, I already have this command on my server xD
Lighta Posted December 31, 2012 Posted December 31, 2012 guess we can add those but in something more general to not but overflowed with more and more npc command, trying to regroup them with topic. Beside that for issit isstand I think it's better to use the readparameter, (like weight, baseclass and such) wich allow to know the value directly in script. (from what I got this function is just made to know player info so would be better to continue there then to create new one) 1
Aleos Posted March 6, 2013 Posted March 6, 2013 If people approve I'll apply it. If anyone has any other suggestions, shoot. sitting.patch 1
clydelion Posted March 6, 2013 Posted March 6, 2013 Looks great mate. On a side note, shouldn't const.txt be updated with those new SP_*? it is just painful to read scripts with just numbers not knowing what that number pertains to(dunno if it is just me).
Aleos Posted March 6, 2013 Posted March 6, 2013 Yeah I was thinking of giving it a value in the const but as you can see there are a few that don't exist. I didn't want to label it bSitting either since it's not really a bonus which in my reasoning is why many things aren't defined there (Like killedrid, killerrid, etc). I lied, I just noticed they are labeled above the rest of the statuses.
Euphy Posted March 6, 2013 Author Posted March 6, 2013 @Aleos: Looks good, but why did you write 'script_pushint'? Here's some documentation: script_commands.txt.patch @clydelion: I agree, but they're not used in very many scripts; it seems like a good idea, though. Would you like to do it?
Aleos Posted March 6, 2013 Posted March 6, 2013 Sorry, the pushint was a copy-pasta mistake. Applied in r17174.
Recommended Posts