void Script::setBlockingHotspotScript(uint16 charId, uint16 scriptIndex, uint16 v3) { Resources &r = Resources::getReference(); uint16 offset = r.getHotspotScript(scriptIndex); if (charId == PLAYER_ID) Room::getReference().setCursorState(CS_SEQUENCE); Hotspot *hs = r.getActiveHotspot(charId); hs->setHotspotScript(offset); hs->currentActions().top().setAction(EXEC_HOTSPOT_SCRIPT); hs->setOccupied(true); }
void Script::setHotspotScript(uint16 hotspotId, uint16 scriptIndex, uint16 v3) { Resources &res = Resources::getReference(); uint16 offset = res.getHotspotScript(scriptIndex); Hotspot *hotspot = res.getActiveHotspot(hotspotId); if (hotspot != NULL) { hotspot->setHotspotScript(offset); } else { HotspotData *hs = res.getHotspot(hotspotId); assert(hs); hs->hotspotScriptOffset = offset; } }
void Script::transformPlayer(uint16 v1, uint16 v2, uint16 v3) { Resources &res = Resources::getReference(); HotspotData *hotspot = res.getHotspot(TRANSFORM_ID); HotspotData *player = res.getHotspot(PLAYER_ID); hotspot->roomNumber = player->roomNumber; hotspot->startX = player->startX - 14; hotspot->startY = player->startY - 10; Hotspot *activeHotspot = res.activateHotspot(TRANSFORM_ID); activeHotspot->setActionCtr(0); activeHotspot->setHotspotScript(0x630); }
void Script::makeGoewinWork(uint16 v1, uint16 v2, uint16 v3) { Resources &res = Resources::getReference(); Hotspot *goewin = res.getActiveHotspot(GOEWIN_ID); assert(goewin); goewin->updateMovement(); goewin->currentActions().addBack(EXEC_HOTSPOT_SCRIPT, 34); goewin->setHotspotScript(0x616); goewin->setDelayCtr(1500); goewin->setTickProc(GOEWIN_SHOP_TICK_PROC); // Set walk to position for Goewin whilst she's working goewin->resource()->walkX = 179; goewin->resource()->walkY = 138; }